⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -------------------------------------------- | |
# 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 | |
# -------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#0> non-block call | |
Thread.new do | |
blahbla... | |
end | |
#1> 4 simple ways to call shell or cmd | |
`ps aux` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Person | |
class Person | |
end | |
#class method | |
class Person | |
def self.address | |
puts "hangzhou" | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def block_new | |
puts Proc.new.call | |
end | |
block_new{"hello"} | |
#slow practice | |
def herp_pass_block(&block) | |
derp_call_block &block | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'fiber' | |
fib = Fiber.new do | |
v = 0 | |
loop do | |
v += 1 | |
Fiber.yield v | |
v.times { print "-"} | |
puts v | |
end |
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yourproject/ | |
- Vagrantfile | |
- manifests/ | |
- centos62-64.pp | |
- modules/ | |
- rbenv/ <-- git submodule of https://github.com/alup/puppet-rbenv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import simplejson | |
import logging | |
import random | |
import re | |
import datetime | |
import string | |
import time | |
import sys | |
import urllib |
OlderNewer