Skip to content

Instantly share code, notes, and snippets.

View adamnengland's full-sized avatar

Adam England adamnengland

View GitHub Profile
@adamnengland
adamnengland / gist:8d7bc14af58480ba2f3e
Created November 18, 2014 20:26
Check sidekiq queue for retry buildup
class RetryMonitor
include Sidekiq::Worker
def perform
retry_queue = Sidekiq::RetrySet.new
if retry_queue.size > 0
# Send an email or do something else.
end
end
end
Example of a working query
db.postalCode.find( { 'geo' :{ $near :{ $geometry :{ type : "Point" ,coordinates : [ -94.58, 39.09 ] } ,$maxDistance : 10000} } } );
GIS Standard: <Longitude,Latitude>
db.businesses.count( { 'geo' :{ $near :{ $geometry :{ type : "Point" ,coordinates : [ -94.595033, 39.102704 ] } ,$maxDistance : 4000} } } );
@adamnengland
adamnengland / about.md
Created August 9, 2011 18:06 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
@adamnengland
adamnengland / gist:1962699
Created March 3, 2012 00:06
Using Textmate for Play/Coffee/LESS development
Install Textmate - http://macromates.com/
Install Play bundle (it is included in the play framework zip, under support/textmate)
Install Less bundle: https://github.com/appden/less.tmbundle (Just download the zip, unzip, and double click on Commands/Save to CSS.tmCommand && Syntaxes/LESS.tmLanguage)
Install Coffee bundle: https://github.com/jashkenas/coffee-script-tmbundle (instructions on page)
Install coffeescript & less compilers to allow compilation from Textmate.
I chose to use npm, you could do it differently.
Installing coffee via npm: http://coffeescriptcafe.com/blog/your-mac-osx-coffeescript-development-environment/
Install Less: npm install less -g
@adamnengland
adamnengland / KillPlay.sh
Created March 20, 2012 21:30
Kill Play when it starts throwing PermGen
pid=`ps -eo pid,args | grep play | \
grep -v grep | cut -c1-6`
kill $pid
@adamnengland
adamnengland / gist:3429042
Created August 22, 2012 20:24
Campfire Sounds
/play tada
/play nyan
/play tmyk
/play rimshot
/play trombone
/play crickets
/play live
/play ohmy
/play greatjob
/play yeah
@adamnengland
adamnengland / gist:4122756
Created November 21, 2012 03:01
Example in coffeescript to force enhanced for loop
adamsList = ['a','b','c']
# Traditional (and more readable)
for x in adamsList
console.log x
#Enhanced for loop (should be faster.
for x in [adamsList.length - 1..0] by -1
console.log x
@adamnengland
adamnengland / gist:4171629
Created November 29, 2012 20:18
Setting Up ElasticSearch & MongoDb River on OS X
brew install elasticsearch
mkdir -p ~/Library/LaunchAgents
ln -nfs /usr/local/Cellar/elasticsearch/0.19.11/homebrew.mxcl.elasticsearch.plist ~/Library/LaunchAgents/
launchctl load -wF ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist
cd /usr/local/Cellar/elasticsearch/0.19.11/bin
plugin -install richardwilly98/elasticsearch-river-mongodb
To stop the ElasticSearch daemon:
launchctl unload -wF ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist
@adamnengland
adamnengland / gist:4346865
Created December 20, 2012 17:15
Count Files and LOC in project
Files: git ls-files | wc -l
LOC: git ls-files | xargs wc -l
@adamnengland
adamnengland / gist:5103545
Created March 6, 2013 22:08
Preparing My Mac for Boxen
Install Full XCode w/ Command Line tools
which rvm (remove if it exists)
which rbenv (remove if it exists)
which chruby (remove if it exists)
Remove Homebrew (https://gist.github.com/mxcl/1173223)
which nvm (remove if it exists)