Skip to content

Instantly share code, notes, and snippets.

function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
function proml {
local BLUE="\[\033[0;34m\]"
local RED="\[\033[0;31m\]"
local LIGHT_RED="\[\033[1;31m\]"
local GREEN="\[\033[0;32m\]"
local LIGHT_GREEN="\[\033[1;32m\]"
[cornice_app(master)]$ git branch test_branch
[cornice_app(master)]$ git checkout test_branch
Switched to branch "test_branch"
[cornice_app(test_branch)]$ mate README
[cornice_app(test_branch)]$ git commit -a -m "Improved file significantly."
[test_branch 6bba901] Improved file significantly.
1 files changed, 1 insertions(+), 0 deletions(-)
[cornice_app(test_branch)]$ git checkout master
Switched to branch "master"
[cornice_app(master)]$ git merge test_branch
require 'rubygems'
require 'rufus/tokyo/tyrant'
db = Rufus::Tokyo::Tyrant.new('localhost', 45001)
puts db.ext(:set_append, 'foo', 'bar')
puts db.ext(:set_append, 'foo', 'bar')
puts db.ext(:set_get, 'foo', '')
db.close
1. apt-get install git
2. apt-get install libbz2-dev
3. cd /tmp
4. gem install rake-compiler
5. gem install ffi
1. OR
2. git clone git://github.com/ffi/ffi.git
3. cd ffi
4. rake gem:install
[chris@chris:~/code/tokyotest]$ ttserver -ext sets.lua
2010-02-24T14:45:14-08:00 SYSTEM --------- logging started [68331] --------
2010-02-24T14:45:14-08:00 SYSTEM server configuration: host=(any) port=1978
2010-02-24T14:45:14-08:00 SYSTEM maximum connection: 8191
2010-02-24T14:45:14-08:00 SYSTEM opening the database: *
2010-02-24T14:45:14-08:00 SYSTEM scripting extension: sets.lua
2010-02-24T14:45:14-08:00 SYSTEM service started: 68331
2010-02-24T14:45:14-08:00 INFO timer thread 1 started
2010-02-24T14:45:14-08:00 INFO worker thread 1 started
2010-02-24T14:45:14-08:00 INFO worker thread 2 started
#================================================================
# Configuring Tokyo Tyrant version 1.1.40 (lua).
#================================================================
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
ubuntu@Production-admin:/srv/pparty$ cloud ssh -n frontend-app -c clouds_qa.rb
PoolParty core loadtime: 0.363369
./clouds_qa.rb:37:in `read': No such file or directory - instance_data/daemon_app_qa_user_data.json (Errno::ENOENT)
from ./clouds_qa.rb:37
from /usr/lib/ruby/gems/1.8/gems/poolparty-1.6.7/bin/../lib/poolparty/base.rb:13:in `instance_eval'
from /usr/lib/ruby/gems/1.8/gems/poolparty-1.6.7/bin/../lib/poolparty/base.rb:13:in `initialize'
from /usr/lib/ruby/gems/1.8/gems/poolparty-1.6.7/bin/../lib/poolparty/pool.rb:7:in `new'
from /usr/lib/ruby/gems/1.8/gems/poolparty-1.6.7/bin/../lib/poolparty/pool.rb:7:in `cloud'
from ./clouds_qa.rb:34
from /usr/lib/ruby/gems/1.8/gems/poolparty-1.6.7/bin/../lib/poolparty/base.rb:13:in `instance_eval'
require 'find'
Find.find("/users/cjohnson/vids") do |path|
basename = File.basename(path)
dir = File.dirname(path)
extname = File.extname(path)
next if FileTest.directory?(path)
next if basename[0,2] == "._"
next if basename == ".DS_Store"
next unless extname =~ /(m2ts|mts)/i
@findchris
findchris / Source files.rb
Created July 22, 2011 01:21
Weird shoulda issue
# app/models/user.rb
class User < ActiveRecord::Base
validates :name, :uniqueness => true, :presence => true
validates :secret, :uniqueness => true, :presence => true
before_validation :assign_secret, :on => :create
private
def assign_secret
// inside of content URL iframe
new easyXDM.Rpc(
{
swf: "http://ourstaticcontent/easyxdm.swf",
},
{
remote: {
test: {}
},
local: { }