Download R here.
Run R. You will be greeted by the R console. You can interactively type in commands and it will respond, allowing you to experiment quickly.
| hexToBuffer = (hex, padding) -> | |
| n = lpad hex.toString(16), '0', padding | |
| list = [] | |
| while n.length > 0 | |
| head = n.substr 0, n.length - 2 | |
| tail = n.substr n.length - 2 | |
| list.unshift parseInt tail, 16 |
| timeout = (interval, callback) -> | |
| setTimeout callback, interval | |
| interval = (interval, callback) -> | |
| setInterval callback, interval | |
| enforce = (interval, options) -> | |
| t = timeout interval, -> | |
| options.onfail() if options.onfail? |
| #!/usr/bin/env Rscript | |
| # ----- | |
| # USAGE | |
| # ----- | |
| # ./galaxy_column ~/desktop/galaxy1014.txt SVZ_conf_lo DG_conf_hi | |
| # --------- | |
| # FUNCTIONS |
| f = File.open __FILE__, 'w' | |
| f.seek DATA.pos | |
| puts f.gets | |
| __END__ | |
| 'tasty!' |
Download R here.
Run R. You will be greeted by the R console. You can interactively type in commands and it will respond, allowing you to experiment quickly.
| normalizeAngle = (a) -> | |
| if a < 0 || a > Math.PI * 2 | |
| Math.abs Math.PI * 2 - Math.abs(angle) | |
| else | |
| angle |
| # Auto-Resizing Text Area | |
| # Works in Chrome, Firefox, and IE7+ | |
| # notes: | |
| # * 'rows' and 'cols' attributes should be set on the textarea | |
| # * 'rows' becomes the minimum number of rows | |
| # * 'overflow' should be set to 'hidden' and 'height' should be set to 'auto' | |
| # sass: |
| SocialProperty.first.facebook_client.put_object '119328154811026', 'feed', { | |
| "message" => 'cool', | |
| "type" => "swf", | |
| "source" => "http://dl.dropbox.com/u/2293356/swf_sample/Viking_Kittens.swf", | |
| "picture" => "http://dl.dropbox.com/u/2293356/swf_sample/Viking_Kittens.png", | |
| "width" => "160", | |
| "height" => "120", | |
| "expanded_width" => "320", | |
| "expanded_height" => "240" | |
| } |
| require 'sinatra/base' | |
| require 'active_support/core_ext/object/blank' | |
| require 'active_support/core_ext/numeric/time' | |
| require 'active_support/core_ext/integer/time' | |
| require 'active_support/core_ext/time/acts_like' | |
| require 'haml' | |
| require 'sass' | |
| require 'compass' | |
| require 'uglifier' | |
| require 'coffee_script' |
| #!/usr/bin/env ruby | |
| # USAGE: | |
| # caramelize mysql://root:root@localhost:8889/sample samples sample.csv | |
| require 'csv' | |
| require 'mysql' | |
| require 'sequel' | |
| def sluggerize string |