Skip to content

Instantly share code, notes, and snippets.

require 'yaml'
TRANSLATIONS = YAML.load_file('en.yml')['en']
def t(path)
current = TRANSLATIONS
path.split('.').take_while { |key| current = current[key] }
current
end
@drogus
drogus / test.html
Created November 11, 2013 01:53
backburner memory bug test
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Ember schedule CPU usage" />
<meta charset=utf-8 />
<title>Ember Starting Point</title>
<script src="backburner.js"></script>
</head>
<body>
# found in excellent post at: http://reefpoints.dockyard.com/ruby/2013/03/29/running-postgresql-9-2-on-travis-ci.html
before_install:
- sudo /etc/init.d/postgresql stop
- sudo cp /etc/postgresql/9.1/main/pg_hba.conf ./
- sudo apt-get remove postgresql postgresql-9.1 -qq --purge
- source /etc/lsb-release
- echo "deb http://apt.postgresql.org/pub/repos/apt/ $DISTRIB_CODENAME-pgdg main" > pgdg.list
- sudo mv pgdg.list /etc/apt/sources.list.d/
- wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
@drogus
drogus / travis.yml
Created November 4, 2013 08:22
install sqlite3 3.7.13 on travis
before_install:
- curl -O http://mirrors.kernel.org/ubuntu/pool/main/s/sqlite3/libsqlite3-0_3.7.13-1_amd64.deb
- curl -O http://mirrors.kernel.org/ubuntu/pool/main/s/sqlite3/sqlite3_3.7.13-1_amd64.deb
- sudo dpkg -i libsqlite3-0_3.7.13-1_amd64.deb sqlite3_3.7.13-1_amd64.deb
deploy:
- provider: heroku
api_key: ...
app: staging-app
on:
branch: master
- provider: heroku
api_key: ...
app: production_app
on:
{
"payload": {
"id": 1,
"number": 1,
"status": null,
"started_at": null,
"finished_at": null,
"status_message": "Passed",
"commit": "62aae5f70ceee39123ef",
"branch": "master",
@drogus
drogus / rvm.sh
Created April 13, 2013 13:53
Rails Girls snippets
curl -#L https://get.rvm.io | bash -s stable --autolibs=3 --ruby
@drogus
drogus / README.md
Last active December 14, 2015 10:10
Single Page Apps fight code snippets

I'm participating in a "Single Page Apps fight" on the wroclove.rb conference and we don't want to make too much noise with the slides, so here are a few snippets that may make it easier to understand my points.

@drogus
drogus / README.md
Created December 12, 2012 16:36 — forked from svenfuchs/README.md

In your Gemfile add:

group :development, :test do
  gem 'micro_migrations', :git => 'git@gist.github.com:33e9f92c229eb808a4fa.git'
end

You might want to add something like this to the Rakefile of apps that use a gem that uses micro_migrations:

ENV['SCHEMA'] = "#{Gem.loaded_specs['your-gem-name'].full_gem_path}/db/schema.rb"

#!/bin/bash
pushd /tmp
git clone https://github.com/travis-ci/travis-artifacts.git
cd travis-artifacts
gem build travis-artifacts.gemspec
gem install travis-artifacts*.gem
popd