Skip to content

Instantly share code, notes, and snippets.

👍
Focusing

Sylvain Utard redox

👍
Focusing
Block or report user

Report or block redox

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Listing.rb
class Listing < ActiveRecord::Base
include AlgoliaSearch
algoliasearch per_environment: true, if: :saleable do
attribute :title, :designer, :price, :description, :size, :category, :price_drops, :dropped, :price_updated_at, :created_at, :cover_photo, :images_processed, :bumped_at, :location, :strata, :retina_cover_photo, :retina_cover_height, :retina_cover_width, :followerno
attributesToIndex ['unordered(designer)', 'unordered(title)', 'unordered(description)', 'category', 'size', 'price']
customRanking ['desc(price_updated_at)']
ranking ['custom', 'desc(followerno)', 'typo', 'geo', 'words', 'proximity', 'attribute', 'exact']
synonyms [
@redox
redox / test.js
Last active Aug 29, 2015
How to redefine ttAdapter()
View test.js
var index = client.initIndex('YourIndexName');
$('input#user_email').typeahead(null, {
// source is a function that takes the query and the typeahead.js callback function as parameters
source: function(query, cb) {
// perform the search
index.search(query, function(success, content) {
if (success) {
// at least one hit ?
if (content.hits.length > 0) {
firstHit = content.hits[0];
@redox
redox / base.html.haml
Last active Dec 6, 2018
Algolia extends HipChat to customer support
View base.html.haml
#chat-box.ubuntu.hidden-xs
.closed
.pull-right
= link_to_function content_tag(:i, nil, class: 'glyphicon glyphicon-chevron-up').html_safe, 'chat.show()'
.m-l-small
= link_to_function 'Chat with us', 'chat.show()'
.opened{style: 'display: none'}
.header
.pull-right
= link_to_function content_tag(:i, nil, class: 'glyphicon glyphicon-plus-sign').html_safe, 'chat.maximize()', class: 'maximize', style: 'display: none'
@redox
redox / Algolia branding.html
Created Mar 6, 2014
Algolia branding code
View Algolia branding.html
<script>
console.log(
"Built With:\n" +
"\n" +
" oooo oooo oo \n" +
" ooooo oooo ooooo ooooo \n" +
" ooooooo oooo oxxxxxxo ooooo oo \n" +
" ooooooooo oooo ooooo ooo oooooooo ooooo oooooo \n" +
" oooooooooo oooo ooooooooooooo oxxxooxxxxxxxxoo ooooo oooo ooooooooooo\n" +
" ooooo ooooo oooo oooooo oooo oxxxooo oooxxxoo ooooo oooo oooo\n" +
View eventbrite.html
<form id="searchform" name="searchform" method="get" action="#" onsubmit="javascript:search()">
<input id="q" name="q" type="text" class="ui-autocomplete-input input-suggestion" maxlength="50" placeholder="Search for (e.g. music, networking)" autocomplete="off" role="textbox" aria-autocomplete="list" aria-haspopup="true" autocorrect="off" spellcheck="false">
<div style="float: left;">
<a class="eb_button medium go js-search-click-action" id="search_button" href="javascript:search()">Search</a>
</div>
<div style="float: left; margin-left: 20px; margin-top: 10px;">
<input type="checkbox" name="around_me" id="around_me" />
<label for="around_me">Around me</label>
</div>
<div style="clear: both; text-align: right; padding-top: 10px; margin-right: 290px;">
View ecommerce.html
<div class='input-group'>
<input autocomplete='off' autocorrect='off' class='form-control' id='searchinput' placeholder='Search a product, brand, category...' spellcheck='false' type='text'>
<span class='input-group-addon'>
<i class='icon-search'></i>
</span>
</div>
<div class='categories'></div>
<div class='brands'></div>
<div class='products'></div>
View leanstack.html
<input class='search-query search-query-small' id='searchbox' type='text'>
<div class="suggestions">
<div class="cats"></div>
<div class="stacks"></div>
<div class="services"></div>
<div class="powered-by-algolia"></div>
</div>
<script src="https://d3ibatyzauff7b.cloudfront.net/assets/algolia/algoliasearch.min.js" type="text/javascript"></script>
<script type="text/javascript">
@redox
redox / .travis.yml
Last active Jan 2, 2016
Testing your Jasmine-based JS project with Travis-ci
View .travis.yml
language: node_js
node_js:
- 0.8
# 'npm test' runs 'grunt test'
before_script:
- npm install -g grunt-cli
# these are secured environment variables encoding ALGOLIA_APPLICATION_ID=****** and ALGOLIA_API_KEY=****************
env:
global:
- secure: ZCrJySSbsKxDV2ps8xDlUA0HwOxPVXj/AkzJHi0oa6MznF0mac9rEtOt0MF+POPewhIrL62vwTVMGWGyHYJ6RvpyW3SVRpHsKlzHhNnDJ6TMFCqVM5yPZ8JZzR8O2+XjQXOmZVZ4P+4ahnr9UCba8gzhj5WNoAUnyQEXXRCklwc=
@redox
redox / Gemfile
Last active Dec 29, 2015
Blazing fast search engine showing relevant results after the first keystroke in your Jekyll blog. Based on Algolia Search + Typeahead.js <3
View Gemfile
gem 'jekyll'
gem 'github-pages'
gem 'algoliasearch'
You can’t perform that action at this time.