Skip to content

Instantly share code, notes, and snippets.

View nuclearsandwich's full-sized avatar

Steven! Ragnarök nuclearsandwich

View GitHub Profile
@JEG2
JEG2 / what_am_i.md
Created February 19, 2014 00:49
I'm trying to solve or at least learn more about this problem.

I have a problem that pretty much boils down to this:

a = [1, 2, 3]
b = [1.1, 2.2, 3.3]

# BEGIN GROSS SOLUTION:  avert your eyes!
results = [ ]
a.each do |i|
 b.each do |j|
require 'uri'
require 'digest/md5'
caOrderValue = '0.00'; # orem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sollicitudin, mi ac lobortis feugiat, ligula augue eleifend libero, vitae suscipit sem nisi ac augue
caOrderReference = URI::escape('blafoo');
caEventID = 'somenumber'; # orem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sollicitudin, mi ac lobortis feugiat, ligula augue eleifend libero, vitae suscipit sem nisi ac augue
caComment = ''; # lorem ipsum
caMultiple = '1';
caItems = ''; # (Optional) orem ipsum dolor sit amet, consectetur adipiscing elit. Morbi sollicitudin, mi ac lobortis feugiat, ligula augue eleifend libero, vitae suscipit sem nisi ac augue.
# Aenean hendrerit, neque at imperdiet auctor, diam eros interdum lorem, eu suscipit augue risus id neque.
@colindean
colindean / dont.rb
Created April 15, 2011 18:13 — forked from acid/dont.rb
require 'digest/md5'
class Hash
def to_query
require 'uri'
self.collect{ |k,v| k.to_s.downcase + '=' + URI::escape(v)}.join('&')
end
end
caPin = "1234"
caSubDomain = "track"
query = {
@debuos512
debuos512 / xmonad.hs
Created April 18, 2011 14:32
My XMonad config file.
import XMonad
import Data.Monoid
import System.Exit
import XMonad.Hooks.SetWMName
import qualified XMonad.StackSet as W
import qualified Data.Map as M
myTerminal = "terminator"
myFocusFollowsMouse :: Bool
@tpope
tpope / account.html.haml
Created May 15, 2011 15:01
Our designers are way more clever than your designers
%fieldset.account_info
- ["First Name","Last Name","Email","Choose Password"].each do |n|
%dl.half
%dt
%label{:class => cycle("required", "", "required", "required")}=n
%dd
%input(type="text")
# Ruby 1.8
m { }
arity: -1
proc call arg check: no
wraps values: n/a
m { || }
arity: 0
proc call arg check: yes, 0
@macournoyer
macournoyer / app.ru
Created August 19, 2011 17:02
The invisible block web framework. In honor of _why.
# rackup app.ru
require "./invisible"
app = Invisible.new do
get "/" do
render do
h1 "Why?"
p "Because."
end
require 'thread'
require 'json'
require 'net/http'
require 'uri'
require 'betabrite'
require 'psych'
require 'usb'
class StreamClient
def initialize user, pass
@avdi
avdi / when.rb
Created December 5, 2011 22:17
Experimenting with Object#when in Ruby
def maybe_a_sandwich
nil
end
# Methods that might return nil are annoying. We want to write a nice
# confident chain:
result = nil
result = maybe_a_sandwich.add_horseradish.get_into_my_belly! rescue $!
result # => #<NoMethodError: undefined method `add_horseradish' for nil:NilClass>
@bmizerany
bmizerany / gist:1557817
Created January 4, 2012 00:48
Clueless Recruiter
From: Matthew Greenburg <mgreenburg@astreya.com>
CC: Carl Narcisse <cnarcisse@astreya.com>
Blake,
My name is Matt Greenburg with Astreya Partners, an IT staffing company in Santa Clara. We bring on full time employees of Astreya to work on-site at our clients' locations. I came across your resume and was wondering if you were entertaining new career opportunities at this time. I think you would be a great fit for a position we have open as a Web Application Developer, Ruby on Rails.This position is located in Cupertino, CA at a large very well known company. Think big!
Web Application Developer, Ruby on Rails
Successful team members must be able to document, design, develop, validate and maintain complete solutions to specific business needs with minimal supervisory input in a dynamic, result driven environment. These contributors need a wide variety and depth of web-related (including associated back end) technical skills and are well organized, self-motivated people with excellent communication skills