Skip to content

Instantly share code, notes, and snippets.


Ryan Carmelo Briones ryanbriones

View GitHub Profile

Can anybody tell me what's going on here? Everything I've read says to use "\N" for both STRINGs and non-STRINGs, but Hive is treating them differently. WTF?

View gist:9d15f6c5970a75ad1a5e
function square(n) {
return n * n;
function double(n) {
return n * 2;
function compose() {
var originalRecur = [];
ryanbriones / 0_input.html
Created Feb 6, 2014
Is there something in Ruby (in an existing gem?) that will take an HTML String, parse out a form, and return URI-encoded query string of the fields/values a la jQuery's form.serialize?
View 0_input.html
<input type="text" name="post[title]" value="Some Title" />
<textarea name="post[body]">This is my post body</textarea>
ryanbriones / gist:6144388
Created Aug 3, 2013
JSON musical notation
View gist:6144388
"key_signature": {
"name": "C major",
"sharps": [],
"flats": [],
"time_signature": {
"upper": 4,
"lower": 4
ryanbriones / gist:5691547
Created Jun 1, 2013
Civic Needs Issue test
View gist:5691547
require "sinatra"
require "octokit"
class CivicNeedsIssuesList < Sinatra::Base
get "/" do
out = ""
Octokit.list_issues("ryanbriones/civicneeds", {:labels => "need"}).each do |issue|
out << %Q{<a href="/needs/#{issue.number}">##{issue.number} #{issue.title} (#{issue.comments} comments)</a>}


This is a step-by-step tutorial for getting started with R, a powerful programming language for data analysis and visualization. It is aimed at near complete beginners. You'll basically want to be comfortable with spreadsheets and with using your computer's command line.

I slapped this together quickly, so expect some weirdness. Feel free to email me with comments or questions at jpvelez | at |

I learned the following stuff using the UCLA Statistic's Department great R tutorials, so check those out:

ryanbriones / gist:3292129
Created Aug 8, 2012
Chicago Open Data Hack Night R Demo in Incanter
View gist:3292129
;; a naive implementation of the R intro demo from Chicago Open Data Hack Night
;; using clojure and incanter
;; Data and explanation here:
;; * Download incanter-latest (1.2 right now)
;; * run `script/repl`
;; * copy in code
(use '(incanter core io stats charts))
ryanbriones / gist:3243872
Created Aug 3, 2012
Plain HTML "templates", with ERB layout, from Sinatra
View gist:3243872
class MySinatraApplication < Sinatra::Base
get "/some-mockup-path" do
html :somemockup
helpers do
def html(template, options = {}, locals = {})
render :html, template, options, locals
View gist:3171869
tell application "iTunes"
set the current EQ preset to EQ preset "Manual"
tell EQ preset "Manual"
set band 1 to -8
set band 2 to -5
set band 3 to -2
set band 4 to -4
set band 5 to -5
set band 6 to -6
set band 7 to -4
View gist:3134717
dumont:~ ryanbriones$ gem install morning-pages
Fetching: trollop-1.16.2.gem (100%)
Fetching: morning-pages-0.2.1.gem (100%)
Successfully installed trollop-1.16.2
Successfully installed morning-pages-0.2.1
2 gems installed
dumont:~ ryanbriones$ morning-pages help
sh: /Users/ryanbriones/words/2012-07-18: No such file or directory
/Users/ryanbriones/.rvm/gems/ruby-1.9.2-p180/gems/morning-pages-0.2.1/lib/morning-pages.rb:15:in `read': No such file or directory - /Users/ryanbriones/words/2012-07-18 (Errno::ENOENT)
from /Users/ryanbriones/.rvm/gems/ruby-1.9.2-p180/gems/morning-pages-0.2.1/lib/morning-pages.rb:15:in `stats_for_today'
You can’t perform that action at this time.