This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var stopwordsList = ['l','le','la','les','du','de','des','a','du','en','au','aux','dont','par','pour','vos','es','est','sois','soit','sommes','sont','soyez','soyons','suis','étions','eté','êtes','ai','aie','aient','aies','ait','as','aura','aurai','auraient','aurais','aurait','auras','aurez','auriez','aurions','aurons','auront','avaient','avais','avait','avez','aviez','avions','avoirs','avons','ayant','ayez','ayons','eu','eue','eues','eurent','eus','ont']; | |
function removeStopWords(string) { | |
var queryWords = string.split(' '); | |
var finalString = []; | |
for (var i=0; i<queryWords.length-1; ++i) { | |
if (stopwordsList.indexOf(queryWords[i]) !== -1) | |
continue; | |
finalString.push(queryWords[i]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>com.algolia</groupId> | |
<artifactId>algoliasearch</artifactId> | |
<version>[1.2.3,]</version> | |
</dependency> | |
<repository> | |
<id>algoliasearch</id> | |
<name>Algolia Search Client</name> | |
<url>https://raw.githubusercontent.com/algolia/algoliasearch-client-java/master/repository</url> | |
</repository> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<input class="quick_search autocomplete search ac_input example" data-url="/search/quick" id="q" name="q" placeholder="Search: rapper, song title, or lyrics" type="text" autocomplete="off"> | |
<div class="suggestions" style="display: none"> | |
<div class="suggestions-rappers"></div> | |
<div class="suggestions-songs"></div> | |
<div class="suggestions-lyrics"></div> | |
</div> | |
<script src="https://d3ibatyzauff7b.cloudfront.net/assets/algolia/algoliasearch.min.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
$(document).ready(function() { | |
var algolia = new AlgoliaSearch('EBTM1YDM40', '1113dae74afc7b12f3d06259d7154d95'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
var apiClient = new AlgoliaSearch('latency', '6be0576ff61c053d5f9a3225e2a90f76'); | |
var idx = apiClient.initIndex('tvshows'); | |
function displayShowCallback(success, content) { | |
html = ''; | |
for (var i = 0; i < content.hits.length; ++i) { | |
html += '<tr>' + | |
' <td class="text-center"><img src="' + content.hits[i].image + '></td>' + | |
' <td class="text-left">' + content.hits[i].show_name + '</td>' + |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
var last_query = ''; | |
var client = new AlgoliaSearch('latency', '6be0576ff61c053d5f9a3225e2a90f76'); | |
function searchCallback(success, content) { | |
$('.browser-page-help').hide(); | |
if (content.results.length < 2 || content.results[0].query != last_query) { | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Open terminal and type | |
defaults write com.google.Chrome.plist AppleEnableSwipeNavigateWithScrolls -bool FALSE | |
# For mavericks | |
defaults write com.google.Chrome AppleEnableSwipeNavigateWithScrolls -bool FALSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var $touchArea = $('#touchArea'), | |
touchStarted = false, // detect if a touch event is sarted | |
currX = 0, | |
currY = 0, | |
cachedX = 0, | |
cachedY = 0; | |
//setting the events listeners | |
$touchArea.on('touchstart mousedown',function (e){ | |
e.preventDefault(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
A (very) WIP collection of optimized/recommended jQuery plugin patterns | |
from @addyosmani, @cowboy, @ajpiano and others. | |
Disclaimer: | |
----------------------- | |
Whilst the end-goal of this gist is to provide a list of recommended patterns, this | |
is still very much a work-in-progress. I am not advocating the use of anything here | |
until we've had sufficient time to tweak and weed out what the most useful patterns |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Skeleton jQuery plugin | |
function($) | |
{ | |
$.fn.myPlugin = function( options ) | |
{ | |
// options. | |
$.fn.myPlugin.settings = $.extend( {}, $.fn.myPlugin.defaults, options ); | |
// Go through the matched elements and return the jQuery object. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.log = function () { | |
log.history = log.history || []; | |
log.history.push(new Date(), arguments); | |
if (this.console) { | |
arguments.callee = arguments.callee.caller; | |
var a = [].slice.call(arguments); | |
(typeof console.log === "object" ? log.apply.call(console.log, console, a) : console.log.apply(console, a)) | |
} | |
log.displayHistory = function() { | |
for (var i=0, len=window.log.history.length; i<len; i++) |
NewerOlder