This file contains hidden or 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
| $("#searchbox").autocomplete | |
| source: (req, add) -> | |
| terms = LN.helpers.luceneEscape(req.term).split " " | |
| querystring = " " | |
| for term in terms | |
| do (term) -> | |
| if term != '' | |
| querystring = querystring + " name.start:" + term | |
| two_days_ago = moment().utc().subtract('days', 2).format("YYYY-MM-DDTHH:mm:ss") + "Z" |
This file contains hidden or 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
| http://localhost:9200/locations/_search?pretty=true&callback=LN.Callbacks.registeredCallbacks["-1831663469"]&source={"sort":{"size_estimate":{"order":"desc"}},"size":1,"filter":{"geo_distance":{"distance":"100km","location":{"lat":35.236514,"lon":-89.922871}}}}&_=1359063233523 |
This file contains hidden or 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
| http://localhost:9200/locations/_search?pretty=true&callback=LN.Callbacks.registeredCallbacks["-1831663469"]&source={"sort":{"size_estimate":{"order":"desc"}},"size":1,"filter":{"geo_distance":{"distance":"100km","location":{"lat":35.236514,"lon":-89.922871}}}}&_=1359063233523 | |
| http://localhost:9200/events/_search?pretty=true&callback=LN.Callbacks.registeredCallbacks["1549501024"]&source={"query":{"bool":{"must":[{"range":{"start_time":{"gte":"2013-01-25T01:59:59Z","lt":"2013-07-24T06:59:59Z"}}},{"field":{"featured_artist":true}}]}},"sort":[{"start_time":{"order":"asc"}}],"filter":{"geo_distance":{"distance":"50km","location":{"lat":35.1187171875,"lon":-89.9533898438}}},"size":15,"from":0}&_=1359063298321 | |
| http://search.livenation.com/events/_search?pretty=true&callback=LN.Callbacks.registeredCallbacks["-2121642443"]&source={"query":{"bool":{"must":[{"range":{"start_time":{"gte":"2013-01-24T23:59:59Z","lt":"2013-07-24T04:59:59Z"}}},{"field":{"featured_artist":true}}]}},"sort":[{"start_time":{"order":"asc"}}], |
This file contains hidden or 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
| #!/usr/bin/env sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/2279031/hack.sh | sh | |
| # |
This file contains hidden or 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
| function addr(arr, v, n) { | |
| var steps = n === 0 ? arr.length-1 : Math.abs(n); | |
| var step = n < 0 ? -1 : 1; | |
| var i = n < 0 ? arr.length-1 : 0; | |
| var count = arr.length-1; | |
| while(count > 0 && steps > 0) { | |
| console.log(arr[i]) | |
| if(arr[i] === v) { | |
| arr[i]++; |
This file contains hidden or 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
| [{ | |
| "id": "OBxNkQ6BCHqFUQ", | |
| "print_on": "2012-03-18", | |
| "batch_state": "current", | |
| "current": true, | |
| "last_status": null, | |
| "last_status_on": null, | |
| "photos": [{ | |
| "id": "jBPaF_rCuvHxBQ", | |
| "ratio": 1.33, |
This file contains hidden or 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
| # I am using this for an API. So auth key is passed as user name. | |
| Warden::Strategies.add(:basic) do | |
| def auth | |
| @auth ||= Rack::Auth::Basic::Request.new(env) | |
| end | |
| def store? | |
| false |
This file contains hidden or 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
| // User | |
| var PPM = { | |
| user_id: 0, | |
| init: function(uid){ | |
| var self = this; | |
| this.user_id = uid; | |
| Plankton.sync('http://draw.test.envolve.com/ppmetrics/', function(data){ self.after_sync(self, data) }); | |
| }, | |
| after_sync: function(self, data){ |
This file contains hidden or 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
| source 'http://rubygems.org' | |
| # Rails Gems | |
| gem 'rails', :git => 'git://github.com/rails/rails.git', :branch => '3-1-stable' | |
| gem 'sprockets', :git => 'git://github.com/sstephenson/sprockets.git' | |
| gem 'sqlite3' | |
| group :assets do | |
| gem 'sass-rails', :git => 'git://github.com/rails/sass-rails.git', :branch => '3-1-stable' | |
| # gem 'sass-rails', "~> 3.1.0.rc" |
This file contains hidden or 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
| # in config/environments/production.rb | |
| # config.force_ssl = true | |
| # config.middleware.use "Forcessl" | |
| # Make sure redirection happens before forcing ssl | |
| # config.middleware.insert_before 'Rack::SSL', 'Forcessl' | |
| # in lib/forcessl.rb | |
| # change *. to your domain | |
| class Forcessl |