Skip to content

Instantly share code, notes, and snippets.

View fire9's full-sized avatar
🏠
Working from home

fire9 fire9

🏠
Working from home
View GitHub Profile
# --------------------------------------------
# General
# --------------------------------------------
set :shared_children, %w(cache logs) # Shared directories, these directories contain generated content which should not be wiped out during deployments.
set :application, "domain.com" # Application name
set :deploy_to, "/var/www/#{application}/#{stage}" # Path where files are deployed to ...
# --------------------------------------------
# Server
# --------------------------------------------
@SaitoWu
SaitoWu / runable.rb
Created February 11, 2011 08:57
exec something on ruby.
#0> non-block call
Thread.new do
blahbla...
end
#1> 4 simple ways to call shell or cmd
`ps aux`
@SaitoWu
SaitoWu / eigenclass.rb
Created March 16, 2011 07:53
some ruby meta programming demo.
#Person
class Person
end
#class method
class Person
def self.address
puts "hangzhou"
end
end
@SaitoWu
SaitoWu / proc.rb
Created March 17, 2011 14:44
magic ruby proc demo
def block_new
puts Proc.new.call
end
block_new{"hello"}
#slow practice
def herp_pass_block(&block)
derp_call_block &block
end
@SaitoWu
SaitoWu / fibers.rb
Created June 28, 2011 05:47
ruby fibers exercise
require 'fiber'
fib = Fiber.new do
v = 0
loop do
v += 1
Fiber.yield v
v.times { print "-"}
puts v
end
@lucasfais
lucasfais / gist:1207002
Created September 9, 2011 18:46
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 21, 2024 15:59
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@benders
benders / README
Created July 4, 2012 01:17
Using Vagrant and puppet-rbenv
yourproject/
- Vagrantfile
- manifests/
- centos62-64.pp
- modules/
- rbenv/ <-- git submodule of https://github.com/alup/puppet-rbenv
@saga
saga / gist:4137880
Created November 24, 2012 00:54
appfog get youtube
#!/usr/bin/env python
import simplejson
import logging
import random
import re
import datetime
import string
import time
import sys
import urllib