Skip to content

Instantly share code, notes, and snippets.

@kaichen
kaichen / chef_solo_bootstrap.sh
Created August 30, 2012 01:47 — forked from ryanb/chef_solo_bootstrap.sh
Bootstrap Chef Solo
#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline5-dev libyaml-dev
cd /tmp
wget http://ruby.taobao.org/mirrors/ruby/1.9/ruby-1.9.3-p194.tar.gz
tar -xvzf ruby-1.9.3-p194.tar.gz
cd ruby-1.9.3-p194/
./configure --prefix=/usr/local --disable-install-rdoc
make
# -*- encoding : utf-8 -*-
set :assets_dependencies, %w(app/assets lib/assets vendor/assets Gemfile.lock config/routes.rb)
namespace :deploy do
namespace :assets do
desc <<-DESC
Run the asset precompilation rake task. You can specify the full path \
to the rake executable by setting the rake variable. You can also \
def tip(msg); puts; puts msg; puts "-"*100; end
#
# 30 Ruby 1.9 Tips, Tricks & Features:
# http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/
#
tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2"
tip "Ruby 1.9 supports named captures in regular expressions!"
#!/bin/sh
# install last version of dm, do, extlib...
sudo gem install do_mysql data_objects extlib
sudo gem install dm-core dm-aggregates dm-migrations dm-timestamps dm-types dm-validations dm-serializer dm-sweatshop dm-is-tree --no-ri --no-rdoc
#!/bin/bash
sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
sudo env ARCHFLAGS="-arch x86_64" gem install do_mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
@kaichen
kaichen / _gem
Created September 17, 2009 02:17 — forked from alexvollmer/_gem
#compdef gem gem1.9
gem_general_flags=("(-h --help)"{-h,--help}"[Get help on this command]"
"(-V --verbose)"{-V,--verbose}"[Set the verbose level of output]"
"(-q --quiet)"{-q,--quiet}"[Silence commands]"
"--config-file[Use this config file instead of default]:file:_files"
"--backtrace[Show stack backtrace on errors]"
"--debug[Turn on Ruby debugging]"
$nul_arg
)
@kaichen
kaichen / run_tags.rb
Created September 9, 2009 14:56 — forked from bryanl/run_tags.rb
a useful script for vim user
#!/usr/bin/env ruby
#-*-ruby-*-
# A script to run ctags on all .rb files in a project. Can be run on
# the current dir, called from a git callback, or install itself as a
# git post-merge and post-commit callback.
CTAGS = `which ctags`.chomp
HOOKS = %w{ post-merge post-commit post-checkout }
HOOKS_DIR = '.git/hooks'