Skip to content

Instantly share code, notes, and snippets.

@ryanbriones
ryanbriones / README.md
Created August 8, 2014 15:49
WTF NULL HIVE?

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?

function square(n) {
return n * n;
}
function double(n) {
return n * 2;
}
function compose() {
var originalRecur = [];
@ryanbriones
ryanbriones / 0_input.html
Created February 6, 2014 14:44
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?
<form>
<input type="text" name="post[title]" value="Some Title" />
<textarea name="post[body]">This is my post body</textarea>
</form>
@ryanbriones
ryanbriones / gist:6144388
Created August 3, 2013 00:00
JSON musical notation
{
"key_signature": {
"name": "C major",
"sharps": [],
"flats": [],
},
"time_signature": {
"upper": 4,
"lower": 4
},
@ryanbriones
ryanbriones / gist:5691547
Created June 1, 2013 19:57
Civic Needs Issue test
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>}
end
@ryanbriones
ryanbriones / intro_r_tutorial.md
Created August 10, 2012 02:22 — forked from jpvelez/intro_r_tutorial.md
Intro to R Tutorial

WHAT IS THIS?

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 | gmail.com

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

@ryanbriones
ryanbriones / gist:3292129
Created August 8, 2012 04:44
Chicago Open Data Hack Night R Demo in Incanter
;; a naive implementation of the R intro demo from Chicago Open Data Hack Night
;; using clojure and incanter
;;
;; Data and explanation here: http://gathers.us/events/open-gov-hack-night-organized-by-open-city-ebf93
;;
;; * Download incanter-latest (1.2 right now)
;; * run `script/repl`
;; * copy in code
(use '(incanter core io stats charts))
@ryanbriones
ryanbriones / gist:3243872
Created August 3, 2012 02:54
Plain HTML "templates", with ERB layout, from Sinatra
class MySinatraApplication < Sinatra::Base
get "/some-mockup-path" do
html :somemockup
end
helpers do
def html(template, options = {}, locals = {})
render :html, template, options, locals
end
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
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'