This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Routing Error | |
No route matches {:action=>"show", :controller=>"programs", :user_id=>nil, :id=>#<Program _id: BSON::ObjectId('4ea2132db7e9fe27ce000001'), author_username: "nuclearsandwich", slug: "test", source_code: "Shoes.app do\n stack do\n 3.times do\n para \"Hello World!\", :font => \"TakaoGothic\"\n end\nend\n", title: "test">} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A Look at Case Expressions in Ruby | |
# ================================== | |
# | |
# *Side note: Playing with docco as a formatting tool for this article. Excuse | |
# the lines with solitary* `:parabreak` *symbols, they're to make paragraphs on the | |
# right hand side.* | |
# | |
# Ruby, like many languages has a case-when construct for more refined | |
# conditional execution than if-then-else can provide. Technically all case | |
# constructs could be written as if-then-else-if-then...else but you wouldn't |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Pre-commit hook to make a mysql dump right before committing and add it to the commit. | |
# | |
## Change the following values to suit your local setup. | |
# The name of a database user with read access to the database. | |
DBUSER=root | |
# The password associated with the above user. Leave commented if none. | |
#DBPASS=seekrit | |
# The database associated with this repository. | |
DBNAME=dplay |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | |
NewerOlder