Skip to content

Instantly share code, notes, and snippets.

View nuclearsandwich's full-sized avatar

Steven! Ragnarök nuclearsandwich

View GitHub Profile
@nuclearsandwich
nuclearsandwich / after_railsbridge.md
Last active September 28, 2015 11:08
Railsbridge Post-workshop follow up

So you went to RailsBridge.. What Now?

You just had an awesome time at RailsBridge, your eyes are open to the awesome new realm of what can be accomplished with a bit of effort and a good attitude. But what do you do now that the workshop day is over? The end of a workshop isn't the end of your programming career, it's the start.

Often times, it is harder to decide where to go next, rather than whether to continue at all. There's tons to explore in greater detail than we have time to

@nuclearsandwich
nuclearsandwich / asking_for_a_challenge.rb
Created December 9, 2011 19:51
Question.. is there such a thing as a Database-leve #zip with ActiveRecord.
# Given a hash of primary keys and scores such as:
scores = { 14 => 292.0, 11 => 999.0, 42 => 417.0 } # which is stored in Redis/calculated on the fly
# And an ActiveRecord model Model with a constraint.
class Model < ActiveRecord::Base
scope :passes_constraints, where(:has_constraint => nil)
end
# Say there are 50 items in `scores`, and the pass/fail constraint status of each is unknown.
# What is the most efficient way to take a 5-element slice of the models passing constraints in the order given by the score?
@nuclearsandwich
nuclearsandwich / gist:1592121
Created January 11, 2012 00:16
Maven stacktrace from building Redline.
└─> mvn clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Redline Smalltalk 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ redline ---
[INFO] Deleting /home/steven/Code/redline-smalltalk/target
[INFO]
bison --output /home/steven/Code/fancy/lang/lib/parser/ext/parser.c -d -v /home/steven/Code/fancy/lang/lib/parser/ext/parser.y
/home/steven/Code/fancy/lang/lib/parser/ext/parser.y:182.17-25: warning: type clash on default action: <object> != <>
/home/steven/Code/fancy/lang/lib/parser/ext/parser.y: conflicts: 328 shift/reduce, 89 reduce/reduce
/home/steven/Code/fancy/lang/lib/parser/ext/parser.y:304.19-306.17: warning: rule useless in parser due to conflicts: return_statement: RETURN
flex --outfile /home/steven/Code/fancy/lang/lib/parser/ext/lexer.c --header-file=lexer.h /home/steven/Code/fancy/lang/lib/parser/ext/lexer.lex
rbx /home/steven/Code/fancy/lang/lib/parser/ext/extconf.rb
checking for main() in -lfl... yes
creating Makefile
flex --outfile /home/steven/Code/fancy/lang/boot/rbx-compiler/parser/lexer.c --header-file=lexer.h /home/steven/Code/fancy/lang/boot/rbx-compiler/parser/lexer.lex
bison --output /home/steven/Code/fancy/lang/boot/rbx-compiler/parser/parser.c -d -v /home/steven/Code/fancy/lang/boot/
@nuclearsandwich
nuclearsandwich / gist:1654256
Created January 21, 2012 22:20
Installing npm 1.0.x within Nave subshell failure.
└─> bin/nave use 0.5.6
Already installed: 0.5.6
using 0.5.6
└─> curl http://npmjs.org/install.sh | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 7881 100 7881 0 0 8022 0 --:--:-- --:--:-- --:--:-- 22976
tar=/bin/tar
version:
module Cage
class HTTPStatus < BasicObject
STATUSES = ::Hash.new "UNKNOWN"
STATUSES.merge! ::Hash[
100 => "CONTINUE",
101 => "SWITCHING PROTOCOLS",
102 => "PROCESSING",
103 => "CHECKPOINT",
122 => "REQUEST-URI TOO LONG",
200 => "OK",
# Require the list constructor object
List = require '../lib/list'
module.exports = listMapper = {
# Tracker objects in order to mimic a functional database layer until later
# in the development cycle.
idCounter: 0
allLists: []
@nuclearsandwich
nuclearsandwich / gist:2040992
Created March 15, 2012 01:19
Good Eats and Drinks for Clojure/west Attendees

Good Eats and Drinks for Clojure/west Attendees

NONDISCLAIMER: I am not being paid by any of the establishments below. I am acquainted with the proprietors of Good Karma and Single Barrel but that doesn't make them bad people nor does it decrease the phenomenality of their wares.

Clojure/west is only feeding us lunch on Friday. That leaves us to our own devices for Friday's dinner, after-after-party drinks, Saturday's lunch, dinner, and drinks.

Furthermore, Clojure/west's website lists the official guide from the city of San Jose, which includes a lot of duds and places far away from the conference

@nuclearsandwich
nuclearsandwich / gist:2045455
Created March 15, 2012 17:26
Getting from SFO to San Jose Marriott the Hard Way

Getting from SFO to San Jose Marriott the Hard Way

If you flew into SFO for Clojure/west, let me be the first to apologise. You have a long journey ahead of you.

Alex posted some links to the airport shuttle in the Guidebook app. Since I work in San Francisco occasionally but attend class in Downtown San José, I'm all too familiar with the arduous task of getting from one to the other. Here's how I do it.

└─> rvm --version
rvm 1.11.2 (latest) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.beginrescueend.com/]
└─> rvm use rbx
Using /home/steven/.rvm/gems/rbx-head
┌─[ 0 ][ ○$ ][ 11:22 ][ Temeraire:~ ]
└─> gem list
*** LOCAL GEMS ***