Skip to content

Instantly share code, notes, and snippets.

resources:
- name: project-a
type: git
source:
uri: https://github.com/msarahan/ci_test.git
- name: project-b
type: git
source:
uri: https://github.com/msarahan/ci_test.git
#!/usr/bin/env bash
VERSION_TAGS=$(git log --pretty=oneline --grep '[0-9]$' \
--branches=origin/remote -- www/version.txt | cut -d ' ' -f1)
for commit_hash in $VERSION_TAGS
do
version=$(git show $commit_hash:www/version.txt)
git tag $version $commit_hash
done
@joonas
joonas / gist:4186011
Created December 2, 2012 00:00
Unicorn script
#!/bin/sh
set -e
# Feel free to change any of the following variables for your app:
TIMEOUT=${TIMEOUT-60}
APP_ROOT=/srv/www/appname/current
PID=$APP_ROOT/tmp/pids/unicorn.pid
RAILS_ENV=production
CMD="cd $APP_ROOT; bundle exec unicorn -D -c $APP_ROOT/config/unicorn.rb -E $RAILS_ENV"
AS_USER=ubuntu
@joonas
joonas / 0-readme.md
Created October 25, 2012 04:27 — forked from sj26/0-readme.md
ruby-1.9.3-p194 cumulative performance patch.

Patched ruby 1.9.3-p194 for 30% faster rails boot

What is?

This script installs a patched version of ruby 1.9.3-p194 with patches for boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84). It also includes the new backported GC from ruby-trunk.

Huge thanks to funny-falcon for the performance patches.

{
"run_list": [
"recipe[nginx::source]",
"recipe[rbenv::ruby_build]"
],
"rbenv": {"group_users": ["ec2-user"]}
}
@joonas
joonas / fileless_file.rb
Created July 7, 2012 01:40 — forked from mkrogh/fileless_file.rb
Carrierwave proccess zipfile contents
#A nice little carrierwave IO faker class
class FilelessFile < StringIO
attr_accessor :original_filename
end
@joonas
joonas / fakeout.rb
Created July 7, 2012 00:02 — forked from matthutchinson/fakeout.rb
fake.rake - a takeout approach and rake task that generates some random fake data for a rails app (using ffaker)
# place this in lib/fakeout.rb
require 'ffaker'
module Fakeout
class Builder
FAKEABLE = %w(User Product)
attr_accessor :report
@joonas
joonas / vagrant.org
Created December 21, 2011 23:52
CentOS Box for Vagrant
class puppet {
group { "puppet":
ensure => present,
}
}
class base {
include pip, puppet
}
# urls.py (not complete by any means)
url(r'^$', 'display_lead_list', name='lead_list'),
url(r'^(?P<id>\d+)/edit/$', 'lead_edit', name='lead_edit'),
# views.py
@login_required
def display_lead_list(request, template_name='lead/lead_list.html'):
LeadFormSet = modelformset_factory(Lead)