Skip to content

Instantly share code, notes, and snippets.

View nuclearsandwich's full-sized avatar

Steven! Ragnarök nuclearsandwich

View GitHub Profile
@nuclearsandwich
nuclearsandwich / gist:e4f7cd408c1ecf663f23
Last active August 29, 2015 14:08
LED Group Buy anonimized order list
+------------+-----------+-----------+---------------+-------------+-----------+
| User code | Cyan LEDs | Pink LEDs | Sky Blue LEDs | SIP Sockets | Status |
+------------+-----------+-----------+---------------+-------------+-----------+
| 0176359551 | 200 | 200 | 200 | 200 | SHIPPED |
| 01cf936915 | 0 | 300 | 510 | 0 | SHIPPED |
| 03c5ecbe87 | 0 | 100 | 200 | 0 | SHIPPED |
| 0857787b02 | 200 | 200 | 200 | 200 | SHIPPED |
| 0b3d83889c | 1 | 1 | 1 | 600 | SHIPPED |
| 15b90bb5c0 | 0 | 0 | 0 | 0 | CANCELLED |
| 17f59bd2c1 | 0 | 0 | 0 | 240 | SHIPPED |
@nuclearsandwich
nuclearsandwich / bitcoin.md
Last active August 29, 2015 14:11
bitcoin.md

bitcoin://1234abc

@nuclearsandwich
nuclearsandwich / coffee.md
Last active August 29, 2015 14:15
Coffee in Austin, TX
  • Cenote
  • Vintage Heart Coffee
  • Figure 8 Coffee Purveyors
  • Caffé Medici
  • Patika Coffee
  • Flat Track Coffee
  • Quickie Pickie
  • Thunderbird
  • Bennu
  • Rio Rita
@nuclearsandwich
nuclearsandwich / output.txt
Created April 25, 2015 10:04
Why is luarocks not showing me the latest lapis version?
$ luarocks search lapis
Search results:
===============
Rockspecs and source rocks:
---------------------------
lapis
@nuclearsandwich
nuclearsandwich / app.lua
Last active August 29, 2015 14:21
Lapis errors with before filter.
local lapis = require("lapis")
local app = lapis.Application()
local github_auth = require("github/auth");
app:enable("etlua")
app.layout = require("views.layout")
app:before_filter(function(self)
if not self.current_user then
self:write({
@nuclearsandwich
nuclearsandwich / christmas.py
Created December 25, 2010 18:39
The Python program I used to make sure my brother's grades allowed him to get his Christmas present.
print("Welcome Jeremy, we've been waiting for you.")
print("We're going to find out if you've been naughty or nice.")
print("Enter your grades one line at a time, then put DONE")
cipher = "Orrn#wr#wkh#ohiw#ri#wkh#Dufdgh#Fdelqhw"
grades = []
grade = input()
@nuclearsandwich
nuclearsandwich / recurse.bash
Created April 20, 2011 05:48
An Archlinux script to refresh Identicurse.
#!/bin/bash
# reCurse
# =======
# Identicurse is awesome. Using the Git development branch is fun!
# But sometimes it crashes! o...o
# When that happens I feel obligated to file a bug report.
# But before I file a bug report, I should pull the latest HEAD from master to
# check if the bug is still present.
# It can get old fast... real fast.
# So I made that process easier for Archlinux folken.
@nuclearsandwich
nuclearsandwich / snidely_poll.rb
Created June 28, 2011 06:53
Which of these would you want to use forever?
# Which ones. Pick one number and one letter. Reply back to
# @nuclearsandwich on identi.ca or @_nuclearsammich on Twitter.
# 1) .snidelyrc
# 2) .snidely
# 3) Snidefile
# 4) Snidely
# 5) Snidefile
# A)
Snidely.render do |configs|
@nuclearsandwich
nuclearsandwich / html.rb
Created August 31, 2011 21:08
Hacktastic HTML DSL
# Only working example so far HTML.new { html { title { "Hello" } } }
# Soon attributes will be working.
class HTML
def initialize &content
@html = ""
instance_eval &content
end
def method_missing tag, *attrs, &content
@nuclearsandwich
nuclearsandwich / grr_active_record.rb
Created September 9, 2011 19:26
ActiveRecord's untraceable monkey patch on Enumerable#find(*args)
# A has_many relation exists between a Twitter account and mentions.
# An instance of the collection of mentions is of class Array, rather than any kind of ActiveRecord relation. So one would assume that standard Enumerable methods work. But...
pry(Api)> cd Account::Twitter.last
pry(#<Api::Account::Twitter:0x10748de58>):1> mentions.class
=> Array < Object # Regular old array.
pry(#<Api::Account::Twitter:0x10748de58>):1> mentions.method :find
=> Array (Enumerable)#find(*arg1) # Looks like #find was defined in Enumerable and so should be Enumerable's find (hint: It isn't)
pry(#<Api::Account::Twitter:0x10748de58>):1> mentions.find { true } # This should return the first element in the Array.
ActiveRecord::RecordNotFound: Couldn't find Aji::Mention without an ID
from /Users/steven/.rvm/gems/ruby-1.9.2-p290@api/gems/activerecord-3.0.10/lib/active_record/relation/finder_methods.rb:287:in `find_with_ids'