Skip to content

Instantly share code, notes, and snippets.

@bryanwongbh
bryanwongbh / cloud9-redis-usage.txt
Created October 24, 2016 06:45 — forked from bchumney/cloud9-redis-usage.txt
Cloud 9 Redis Usage
nada-nix install redis
redis-server --port 16379 --bind $IP
./redis-cli -h $IP -p 16379
//Persistent
echo "bind $IP\nport 16379" > redis.conf
@bryanwongbh
bryanwongbh / rspec_model_testing_template.rb
Created March 25, 2016 08:55 — forked from SabretWoW/rspec_model_testing_template.rb
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# @kyletcarlson
#
# This skeleton also assumes you're using the following gems:
@bryanwongbh
bryanwongbh / Javascript: Detect IE
Created December 18, 2012 14:09 — forked from padolsey/gist:527683
Javascript: Detect IE
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}