As configured in my dotfiles.
start new:
tmux
start new with session name:
class RingBuffer < Array | |
attr_reader :max_size | |
def initialize(max_size, enum = nil) | |
@max_size = max_size | |
enum.each { |e| self << e } if enum | |
end | |
def <<(el) | |
if self.size < @max_size || @max_size.nil? |
As configured in my dotfiles.
start new:
tmux
start new with session name:
Navigate to http://nodejs.org/download/ and on the Linux Binaries (.tar.gz) row click to download the 64-bit version of the current latest release.
Say you've downloaded node-v0.10.7-linux-x64.tar.gz
into the Downloads
directory. Then, open the terminal and type the following:
$ cd ~/Downloads
$ mkdir -p ~/local/node
$ tar xzf node-v0.10.7-linux-x64.tar.gz -C ~/local/node --strip-components=1
$ echo '# Node Enviroment Setup' >> ~/.bashrc
$ echo 'export PATH=$HOME/local/node/bin:$PATH' >> ~/.bashrc
References: | |
http://blog.carbonfive.com/2012/02/27/supporting-cross-domain-ajax-in-rails-using-jsonp-and-cors/ | |
https://github.com/cyu/rack-cors | |
http://nelm.io/blog/2011/11/cors-with-sencha-touch/ | |
http://jessehowarth.com/2011/04/27/ajax-login-with-devise | |
============================================================================================================= | |
GEMFILE | |
============================================================================================================= | |
gem 'rack-cors', :require => 'rack/cors' |
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list | |
# A list of available STUN server. | |
stun.l.google.com:19302 | |
stun1.l.google.com:19302 | |
stun2.l.google.com:19302 | |
stun3.l.google.com:19302 | |
stun4.l.google.com:19302 | |
stun01.sipphone.com | |
stun.ekiga.net |
class Vector | |
constructor: (@x, @y, @z) -> | |
@times: (k, {x,y,z}) -> new this(k * x, k * y, k * z) | |
@minus: (a, b) -> new this(a.x - b.x, a.y - b.y, a.z - b.z) | |
@plus: (a, b) -> new this(a.x + b.x, a.y + b.y, a.z + b.z) | |
@dot: (a, b) -> a.x * b.x + a.y * b.y + a.z * b.z | |
@mag: ({x,y,z}) -> Math.sqrt(x * x + y * y + z * z) | |
@norm: (v) -> @times(1.0 / @mag(v), v) | |
@cross: (a, b) -> new this(a.y * b.z - a.z * b.y, a.z * b.x - a.x * b.z, a.x * b.y - a.y * b.x) |
var express = require('express'), | |
httpProxy = require('http-proxy'), | |
app = express(); | |
var proxy = new httpProxy.RoutingProxy(); | |
function apiProxy(host, port) { | |
return function(req, res, next) { | |
if(req.url.match(new RegExp('^\/api\/'))) { | |
proxy.proxyRequest(req, res, {host: host, port: port}); |
The following document is a written account of the Code School screencasting framework. It should be used as a reference of the accompanying screencast on the topic.
You're probably aren't going to take the time to read this document if you're not interested, but there are a lot of nice side effects caused by learning how to create quality screencasts.
require 'rest_client' | |
require 'json' | |
#Initialization: Load the words into a usable format from the API. | |
#These are the only settings you would need to change if you were a different user: | |
#Goto: https://www.lingq.com/accounts/apikey/ to find your API Key | |
api_key = 'YOUR API KEY GOES HERE. CHANGE THIS!' | |
lang_code = 'ko' #for Korean, en for English, etc. | |
#The voice to use for your target language |