Skip to content

Instantly share code, notes, and snippets.

View nuclearsandwich's full-sized avatar

Steven! Ragnarök nuclearsandwich

View GitHub Profile
@nuclearsandwich
nuclearsandwich / repro_case
Created April 16, 2012 00:55
Possbile Pry indentation bug inside indented input with heredocs
Pry's handling of heredocs within existing indented
blocks such as method definitions. Steps to reproduce:
1. start pry
2. start a method definition
3. Open <<EOF style heredoc (as opposed to <<-EOF)
4. Type any text
5. Close the heredoc
6. End the method
7. Observe that the input buffer does not close until it is cleared with '!'
@nuclearsandwich
nuclearsandwich / Gemfile
Created May 25, 2012 04:31
Something funky with JRuby when bundling standalone.
# A sample Gemfile
source "https://rubygems.org"
# gem "rails"
gem "nokogiri"
class GuessRange
attr_accessor :min, :max
def initialize min, max
@min, @max = min, max
end
def average
(min + max) / 2
end
five_hour_clock = Clock.new(5)
five_hour_clock.next_hour #=> 0
five_hour_clock.next_hour #=> 1
five_hour_clock.next_hour #=> 2
five_hour_clock.reset!
five_hour_clock.pass_time(16) #=> 1
four_hour_clock = Clock.new(4)
@nuclearsandwich
nuclearsandwich / gist:2963591
Created June 21, 2012 03:14 — forked from tjackowiak/gist:2844085
play-windows run error
PLATFORM VERSION INFO
Windows : 6.1.7600.0 (Win32NT)
Common Language Runtime : 4.0.30319.544
System.Deployment.dll : 4.0.30319.1 (RTMRel.030319-0100)
clr.dll : 4.0.30319.544 (RTMLDR.030319-5400)
dfdll.dll : 4.0.30319.1 (RTMRel.030319-0100)
dfshim.dll : 4.0.31106.0 (Main.031106-0000)
SOURCES
Deployment url : http://play-windows.s3.amazonaws.com/Play.application
@nuclearsandwich
nuclearsandwich / IGotStyle.html
Created June 24, 2012 20:43
June 24, 2012 Notes
<!DOCTYPE html>
<html>
<head>
<style>
body {
background-color: white;
color: black;
}
/* every p inside a div */
@nuclearsandwich
nuclearsandwich / debate.rb
Created July 5, 2012 18:16 — forked from keppy/gist:3042484
Method help
# models/debate.rb
class Debate < ActiveRecord::Base
attr_accessible :opposition_id, :proposition_id, :title
validates :proposition_user_id, presence: true
validates :proposition_id, presence: true
validates :title, presence: true
has_many :users
has_one :proposition
@nuclearsandwich
nuclearsandwich / shipit.bash
Created July 12, 2012 00:05
Ship directly from the command line via tmux, weechat, and hubot.
#!/bin/bash
CHAT_SESSION=${CHAT_SESSION:-weechat}
CHAT_ROOM=${CHAT_ROOM:-ops}
GITHUB_ACCOUNT=${GITHUB_ACCOUNT:-$(git config github.user)}
PROJECT=${PROJECT:-"$GITHUB_ACCOUNT/$(basename `pwd`)"}
tmux send-keys -t $CHAT_SESSION "/buffer $CHAT_ROOM" C-m
tmux send-keys -t $CHAT_SESSION "hubot deploy $PROJECT" C-m
@nuclearsandwich
nuclearsandwich / gist:3096307
Created July 12, 2012 06:40
Things I had to do to play Shootmania
  • Enter my email address twice.
  • Download an 800MB file at a snailcrawl or install suspicious download manager. (Opted for snailcrawl)
  • wait 45 minutes for said download with a 20Mb/s pipe.
  • Enter my email address twice more.
  • Get a 65MB "maniaplanet update" I get that your company is maniaplanet but what do I need to update a client I literally JUST DOWNLOADED for?
  • Restart the client thing.
  • enter my email YET AGAIN. Honestly, what. the. balls.
  • log in with username/pass
  • Download a 200MB update.
@nuclearsandwich
nuclearsandwich / rake_routes_output.txt
Created July 15, 2012 19:10
Ruby Sunday Homework
posts GET /posts(.:format) posts#index
POST /posts(.:format) posts#create
new_post GET /posts/new(.:format) posts#new
edit_post GET /posts/:id/edit(.:format) posts#edit
post GET /posts/:id(.:format) posts#show
PUT /posts/:id(.:format) posts#update
DELETE /posts/:id(.:format) posts#destroy