start new:
tmux
start new with session name:
tmux new -s myname
#### | |
# Description:a ruby script to monitor metaq queue size | |
# Requirements: zookeeper | |
# sudo gem install zookeeper | |
# | |
##### | |
require 'rubygems' | |
require 'zookeeper' | |
require 'socket' |
#!/usr/bin/env python | |
import simplejson | |
import logging | |
import random | |
import re | |
import datetime | |
import string | |
import time | |
import sys | |
import urllib |
yourproject/ | |
- Vagrantfile | |
- manifests/ | |
- centos62-64.pp | |
- modules/ | |
- rbenv/ <-- git submodule of https://github.com/alup/puppet-rbenv |
http://en.wikipedia.org/wiki/Google_App_Engine
Run your web applications on Google's infrastructure http://www.stanford.edu/class/ee380/Abstracts/081105-slides.pdf
GAE Runtime http://code.google.com/intl/en/appengine/docs/python/runtime.html
require 'fiber' | |
fib = Fiber.new do | |
v = 0 | |
loop do | |
v += 1 | |
Fiber.yield v | |
v.times { print "-"} | |
puts v | |
end |
def block_new | |
puts Proc.new.call | |
end | |
block_new{"hello"} | |
#slow practice | |
def herp_pass_block(&block) | |
derp_call_block &block | |
end |
#Person | |
class Person | |
end | |
#class method | |
class Person | |
def self.address | |
puts "hangzhou" | |
end | |
end |
#0> non-block call | |
Thread.new do | |
blahbla... | |
end | |
#1> 4 simple ways to call shell or cmd | |
`ps aux` |