Skip to content

Instantly share code, notes, and snippets.

View simeonwillbanks's full-sized avatar
☀️
😎

Simeon Willbanks simeonwillbanks

☀️
😎
View GitHub Profile
@simeonwillbanks
simeonwillbanks / .gemrc
Created September 18, 2013 18:55
example gemrc #gem #gemrc #ruby
# http://guides.rubygems.org/command-reference/#gem_environment
---
install: --ri --rdoc # gem install with docs
update: --ri --rdoc # gem update with docs
verbose: true # Verbosity of the gem command
backtrace: true # Print backtrace when RubyGems encounters an error
@simeonwillbanks
simeonwillbanks / test-install.sh
Last active December 21, 2015 16:48
Use rbenv and zsh to run a test suite against multiple rubies. #ruby #zsh #rbenv #tdd
rubies=(1.8.7-p358 ree-1.8.7-2011.03 1.9.2-p290 1.9.3-p429 2.0.0-p247)
for r in $rubies
do
rbenv local $r; bundle install --without debug; CI=true bundle exec rake;
done
@simeonwillbanks
simeonwillbanks / actual_output.txt
Last active December 20, 2015 04:29
Go by Example: Closing Channels https://gobyexample.com/closing-channels #golang
❯ go run closing-channels.go
sent job 1
sent job 2
sent job 3
sent all jobs
received job 1
received job 2
received job 3
received all jobs
@simeonwillbanks
simeonwillbanks / common.rb
Created June 28, 2013 15:14
#capistrano deploy #bower installed assets #devops #asset_pipeline
namespace :deploy do
namespace :assets do
desc 'install asset dependencies'
task :install, roles: [:assets] do
run "cd #{latest_release} && bower install --no-color"
end
end
end
before 'deploy:assets:precompile', 'deploy:assets:install'
@simeonwillbanks
simeonwillbanks / Gruntfile.js
Last active December 18, 2015 16:19
Use #HAML within a #yeoman #AngularJS app.
'use strict';
var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet;
var mountFolder = function (connect, dir) {
return connect.static(require('path').resolve(dir));
};
module.exports = function (grunt) {
// load all grunt tasks
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
@simeonwillbanks
simeonwillbanks / app.js.coffee
Last active June 25, 2019 06:32
#AngularJS templates and #rails with eager loading -- prefill the AngularJS $templateCache. Inspired by @minhajuddin -- http://minhajuddin.com/2013/04/28/angularjs-templates-and-rails-with-eager-loading
# /code/railsapp/app/assets/javascripts/thing/app.js.coffee
#= require angular/templates
angular.module("thing", ["app.templates"]).value("appName", "thing")
@simeonwillbanks
simeonwillbanks / hash_inverse.rb
Created May 22, 2013 19:46 — forked from NigelThorne/hash_inverse.rb
#ruby #hash #invert
require './hash_inverse'
describe Hash do
describe "when empty and asked for the inverse" do
it "returns an empty hash" do
{}.inverse.must_equal Hash.new
end
end
describe "when mapping are unique and asked for the inverse" do
# spec/support/macros/authentication_macros.rb
module AuthenticationMacros
def sign_in_user
let(:current_user) { Factory.stub(:user) }
before do
sign_in current_user
warden.stub(:authenticate => current_user)
warden.stub(:authenticate! => current_user)
end
@simeonwillbanks
simeonwillbanks / f.rake
Last active December 15, 2015 14:29
#rake namespace alias
namespace :f do
desc "alias for `rake footasticforsure:dowork`"
task :d
Rake::Task["footasticforsure:dowork"].invoke
end
end
# an attempt to identify the commit when hpricot 0.8.3 segfaults
# were introduced.
#
# To be able to use git bisect run, I used fork to run the test-case,
# as otherwise the running process is left in a zombie I don't wanna leave state.
#
# Put this in hpricot source folder (with the Rakefile), then run:
#
# $ git checkout master
# $ git bisect start HEAD 0.8.2