Ubuntu 12.10 setup (rbenv/RVM, Janus, PostgreSQL)
- Some utilities:
sudo apt-get install vim tmux git curl
- Copy/paste from the command line:
def design | |
@template = Template.find_or_create_by_name(params[:name]) | |
end | |
def design_image | |
@template = Template.find_by_name(params[:name]) | |
render layout: false | |
end | |
def save_design |
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc | |
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/ | |
// author: Pawel Kozlowski | |
var myApp = angular.module('myApp', []); | |
//service style, probably the simplest one | |
myApp.service('helloWorldFromService', function() { | |
this.sayHello = function() { | |
return "Hello, World!" |
sudo apt-get install vim tmux git curl
export PATH=${PATH}:/Users/felixtioh/Development/adt-bundle/sdk/platform-tools:/Users/felixtioh/Development/adt-bundle/sdk/tools | |
export PATH=${PATH}:/Users/felixtioh/bin |
;; | |
;; NS CHEATSHEET | |
;; | |
;; * :require makes functions available with a namespace prefix. | |
;; | |
;; * :use makes functions available without a namespace prefix | |
;; (i.e., refers functions to the current namespace). | |
;; | |
;; * :import refers Java classes to the current namespace. | |
;; |
My efforts to port http://www.youtube.com/watch?v=f6kdp27TYZs to Clojure.
func boring(msg string) {
for i := 0; ; i++ {
fmt.Println(msg, i)
time.Sleep(time.Second)
}
/* | |
This is an extension of the famo.us Surface type. It behaves the exact same except that the content | |
property holds a ProxyConstructor object (the type that gets returned by any of the React component | |
functions such as those in React.DOM or created by React.createClass) instead of a string or Node. | |
One thing to note is that the component fed in to content will get an extra prop, _surface, which | |
is the surface object that holds it | |
example usage | |
var TestComponent = React.createClass({ |
Famous.EasyScrollview = class EasyScrollview extends Famous.CView | |
@DEFAULT_OPTIONS: | |
containerSize: [300,300] | |
itemSize: [300,300] | |
direction: 0 | |
paginate: true | |
scrollBarThickness: 26 | |
@DIRECTION_X: 0 | |
@DIRECTION_Y: 1 |
Say i want to extract my ebooks(PDF) from nested folders to a flattened format
find . -iname '*.pdf' -exec cp {} '../mybooks/.' \;
#!/bin/sh | |
## | |
## Usage: ./ovpn-writer.sh SERVER CA_CERT CLIENT_CERT CLIENT_KEY SHARED_SECRET > client.ovpn | |
## | |
server=${1?"The server address is required"} | |
cacert=${2?"The path to the ca certificate file is required"} | |
client_cert=${3?"The path to the client certificate file is required"} | |
client_key=${4?"The path to the client private key file is required"} |