Skip to content

Instantly share code, notes, and snippets.

@baob
baob / create_trello_cards.rb
Last active September 21, 2015 13:02 — forked from ejoubaud/create_trello_cards.rb
Ruby script to create Trello cards
#!/usr/bin/env ruby
# If you're not using rbenv in this script's dir, you may wanna run
# these as `sudo gem install ruby-trello`, etc.
['ruby-trello', 'dotenv'].each do |gem_name|
begin
gem gem_name
rescue LoadError
puts "Running `gem install #{gem_name}`..."
puts "If this takes too long, you may want to run it manually, as `sudo` if needed."
@baob
baob / Countries
Created September 25, 2014 10:10
Countries
["Afghanistan", "afghanistan", 355739],
["Albania", "albania", 358538],
["Algeria", "algeria", 355065],
["American Samoa", "american-samoa", 362246],
["Andorra", "andorra", 358550],
["Angola", "angola", 355088],
["Anguilla", "anguilla", 357953],
["Antarctica", "antarctica-1007062", 1007062],
["Antigua & Barbuda", "antigua-and-barbuda", 357954],
["Argentina", "argentina", 362991],
@baob
baob / gist:4176946
Created November 30, 2012 16:53
Elastic Search File Not Found Errors
... 10 more
[2012-11-30 16:48:58,470][WARN ][index.gateway ] [i-b41873ed] [lodgings][4] failed to snapshot (scheduled)
org.elasticsearch.index.gateway.IndexShardGatewaySnapshotFailedException: [lodgings][4] Failed to perform snapshot (index files)
at org.elasticsearch.index.gateway.blobstore.BlobStoreIndexShardGateway.doSnapshot(BlobStoreIndexShardGateway.java:246)
at org.elasticsearch.index.gateway.blobstore.BlobStoreIndexShardGateway.snapshot(BlobStoreIndexShardGateway.java:160)
at org.elasticsearch.index.gateway.IndexShardGatewayService$2.snapshot(IndexShardGatewayService.java:271)
at org.elasticsearch.index.gateway.IndexShardGatewayService$2.snapshot(IndexShardGatewayService.java:265)
at org.elasticsearch.index.engine.robin.RobinEngine.snapshot(RobinEngine.java:1056)
at org.elasticsearch.index.shard.service.InternalIndexShard.snapshot(InternalIndexShard.java:481)
at org.elasticsearch.index.gateway.IndexShardGatewayService.snapshot(
@baob
baob / gist:3596135
Created September 2, 2012 09:10 — forked from jwieringa/gist:3588181
Specification by Example

Step 1

Identify what the business goal is for building software.

Business goal

Increase repeat sales to existing customers by 50% over the next 12 months

Step 2

From the business goal, derive the scope of the feature(s)

@baob
baob / gist:1389393
Created November 23, 2011 18:06
Activating Git completion for homebrew-installed git
ln -s /usr/local/git/contrib/completion/git-completion.bash /usr/local/etc/bash_completion.d/git
(unless of course /usr/local/etc/bash_completion.d/git already exists, in which case you shouldn't be reading this)
@baob
baob / next_deploy.rb
Created September 9, 2011 13:05
script (a very hacky one) to determine which git commits are safe to deploy next, given the state of the related lighthouse tickets.
#!/usr/bin/env ruby
# this simple (hah!) script is intended to find the commit to be deployed to production next. (Next stage deploy is easy: 'master')
LH_TOKEN = "<your lighthouse token>"
LH_ACCOUNT = "<your account name>"
LH_PROJECT_ID = nil # set to project id if account has more than one project (we just get the first by default)
REMOTE_REVISION_FILE = "/var/www/aspire/current/REVISION"
LOCAL_REVISION_FILE = "/tmp/deploy_next_REVISION"
LH_TICKET_REGEX = /(\[#|[Ll][Hh])(\d+)/ # REGEX to pick the lighthouse ticket out of the commit text
@baob
baob / gist:1147654
Created August 15, 2011 20:00
The 'fast require' patch for rails 1.9.2
Seems to be a backport of something in rails 1.9.3
See https://gist.github.com/1008945 and http://rhnh.net/2011/05/28/speeding-up-rails-startup-time
wget https://gist.github.com/raw/999435/fc2718ac3f488ab2341b65dc2ae5c123f8859bff/fast-require-ruby-19.2-p180 --no-check-certificate
rvm install 1.9.2-p180 --patch fast-require-ruby-19.2-p180 -n fastrequire
@baob
baob / gist:1046417
Created June 25, 2011 12:14
Rails dosn't like 'Task' models #2
Processing GoalsController#summary (for 127.0.0.1 at 2011-06-24 23:56:24) [GET]
Rendering template within layouts/goals
Rendering goals/summary
ActionView::TemplateError (undefined method `quoted_table_name' for Rake::Task:Class) on line #6 of app/views/goals/_small_card.html.erb:
@baob
baob / gist:1046412
Created June 25, 2011 12:10
Rails dosn't like 'Task' models
kanga:aboutgoals andy$ ruby script/console
Loading development environment (Rails 2.3.12)
ruby-1.8.7-p334 :001 > Task
WARNING: Deprecated reference to top-level constant 'Task' found at: /Users/andy/.rvm/gems/ruby-1.8.7-p334@global/gems/rake-0.8.7/lib/rake.rb:2470:in `rakefile_location'
Use --classic-namespace on rake command
or 'require "rake/classic_namespace"' in Rakefile
=> Rake::Task
git pull
[write some code]
git add
git commit
git push # rejected but you remain calm this time
git fetch
git rebase origin/master
git push