Skip to content

Instantly share code, notes, and snippets.

View slpsys's full-sized avatar
💭
💯

Marc Bollinger slpsys

💭
💯
View GitHub Profile
@slpsys
slpsys / tweet_harvest.rb
Created September 27, 2015 17:43
Tweet Harvest: Twitter User Data Dump-to-one-semi-clean-tweet-per-line file
require 'json'
fo = File.open('/tmp/tweetstorm.txt','w')
Dir['./data/js/tweets/*.js'].each do |file|
begin
fh = File.open(file)
data = fh.read
# My Twitter dump had a first line that assigns the JSON data to a variable,
# the rest was valid JSON. Example:
@slpsys
slpsys / marcov.txt
Created September 27, 2015 16:19
marcov
"Pretty stoked on Gmail. Now I (Hate) New plans"
"Dominic Fernow's dad fronting New App to most conferences = fancy pirate hat hat?"
"#seapunk is the Console wizard's "Add a large American Life Choice""
"CSS is Google bus before coffee. And _that_ comfortable."
"Pro Tip: Blacklist coworkers."
"null objects don't want a webserver."
"Seems like sludge metal"
"Keep trollin' trollin' trollin' trollin' trollin' trollin' trollin' trollin' trollin' trollin' trollin' trollin' trollin' trollin' trollin'"
"I be to get rid of Emergency & Poor's."
"Editor's note: there was pitiful, in Ohio."
@slpsys
slpsys / 1_views.sql
Last active September 15, 2015 21:28
warehouse=# CREATE VIEW events.events AS SELECT * FROM events.a UNION SELECT * FROM events.b;
CREATE
warehouse=# CREATE VIEW events.events AS SELECT * FROM events.a UNION ALL SELECT * FROM events.b;
CREATE
@slpsys
slpsys / addition_grammar.y
Created August 12, 2015 06:00
Generating ASTs in JISON
/* lexical grammar */
%lex
%%
\s+ /* skip whitespace */
[0-9]+("."[0-9]+)?\b return 'NUMBER'
"+" return '+'
<<EOF>> return 'EOF'
. return 'INVALID'
select
cast(use2.usename as varchar(50)) as owner,
pgc.oid,
trim(pgdb.datname) as Database,
trim(pgn.nspname) as Schema,
trim(a.name) as Table,
(b.mbytes / 1024) gbytes,
a.rows,
((case when a.rows > 0 then b.mbytes / a.rows::real end) * 1024) kb_per_row,
round(b.mbytes / (sum(b.mbytes) over ())::real * 100, 4) pct_of_cluster
@slpsys
slpsys / 0_reuse_code.js
Last active August 29, 2015 14:12
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@slpsys
slpsys / bootstrap.sql
Last active December 18, 2017 21:28
Schema + sample data for regs / subs over time SQL question
# Drop the Coderpad default tables
drop table if exists alerts;
drop table if exists departments;
drop table if exists employees;
drop table if exists employees_projects;
drop table if exists projects;
drop table if exists sales;
drop table if exists signup_flow_events;
drop table if exists stores;
drop table if exists products;
(ns utils)
(def ^:private baphomet
[" ._ ,"
" (`).. ,.-')"
" (',.)-.. ,.-(..`)"
" (,.' ,.)-.. ,.-(. `.. )"
" (,.' ..' .)-.. ,.-( `.. `.. )"
" (,.' ,.' ..')-. ,.-( `. `.. `.. )"
" (,.' ,.' ,.' )-.-(' `. `.. `.. )"
(ns generativity
(:use [cascalog api]))
(defn one_of [seq] (vec (map vector seq)))
(deffilterop forbid
([var comparator val]
(not (comparator var val)))
([var op val comparator comparee]
(not (comparator (op var val) comparee))))

Essential Bruce Springsteen All albums and tracks appear in chronological order.

  1. Greetings from Asbury Park
  • lolno
  1. The Wild, The Innocent, & The E Street Shuffle
  • Rosalita (Come out Tonight)
  • Incident on 57th Street