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
knife node show 4_box_lamp-loadbalancer-0 -ahaproxy #run on dev machine | |
haproxy: | |
app_server_role: app_server | |
balance_algorithm: roundrobin | |
enable_admin: true | |
enable_ssl: false | |
incoming_port: 80 | |
member_max_connections: 100 | |
member_port: 8080 |
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
// JQuery Best Practices | |
/************* Scope *********************/ | |
// write methods that add handlers etc. so that they can be re-used in scopes other than document.ready | |
// http://www.braindonor.net/blog/jquery-best-practices-part-1-managing-scope/406/ | |
function my_button(scope) { | |
scope.find('.button').click(function(){ |
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
mkdir -p $rvm_path/patches/ruby/1.9.3/p385 | |
curl https://github.com/funny-falcon/ruby/compare/p385...p385_falcon.diff > $rvm_path/patches/ruby/1.9.3/p385/falcon.patch | |
rvm reinstall 1.9.3-p385 --patch falcon |
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
settings = { | |
jshint: true, | |
editor: { | |
theme: "blackboard", | |
indentUnit: 2, | |
smartIndent: true, | |
tabSize: 2, | |
indentWithTabs: false, | |
autoClearEmptyLines: true, | |
lineWrapping: true, |
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
# assuming alias pgrep="ps axu | grep -v 'grep' | grep " | |
kill `pgrep "unicorn master" | awk '{print $2}' | tr "\n" " "` |
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
egrep -rh --exclude=ember* --exclude=*raphael* --exclude=*jquery* "this.get\(.*\)" * | sed -E "s/.*this.get..([^'\"]+)['\"].*/\\1/g" | sort | uniq -c | sort |
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
var UrlExists = Ember.Object.extend({ | |
test: function(url){ | |
var promise = Ember.Deferred.create(); | |
if(Ember.isEmpty(url)){ | |
promise.reject(false); | |
} else { | |
$.getJSON("http://query.yahooapis.com/v1/public/yql?"+ | |
"q=select%20*%20from%20html%20where%20url%3D%22"+ | |
encodeURIComponent(url)+"%22&format=json'&callback=?", | |
function(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
# will skip *.js.erb files | |
function slimify() { | |
# because gem install is slow, particularly if installing nokogiri | |
if gem list html2haml | grep html2haml;then | |
if gem list haml2slim | grep haml2slim; then | |
gem update html2haml haml2slim -N | |
else | |
gem update html2haml -N | |
gem install haml2slim -N |
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
require 'spec_helper' | |
describe "shopify api nested resources", unless: ENV['LIVE_SHOPIFY_SPECS_TOKEN'].nil? do | |
before(:all) do | |
session = ShopifyAPI::Session.new(ENV['LIVE_SHOPIFY_SPECS_DOMAIN'], ENV['LIVE_SHOPIFY_SPECS_TOKEN']) | |
ShopifyAPI::Base.activate_session(session) | |
@old_ar_logger = ActiveResource::Base.logger | |
@created = [] | |
ActiveResource::Base.logger = Logger.new STDOUT if ENV['LOG_SHOPIFY'] | |
WebMock.disable! |
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
alias rsp1="script -q /dev/null rspec spec --fail-fast --order defined | tee /tmp/lastrspec; ansifilter /tmp/lastrspec > /tmp/tmplastrspec; mv /tmp/tmplastrspec /tmp/lastrspec" | |
rsplast() { | |
local rcmd=`grep -e '^rspec ' /tmp/lastrspec | cut -f 2 -d ' '` | |
# local rcmd=`grep -e '^rspec ' /tmp/lastrspec` | |
echo "rspec $rcmd" | |
bundle exec rspec $rcmd | |
history -s bundle exec rspec $rcmd | |
} |