Skip to content

Instantly share code, notes, and snippets.

# initialize a stack
# for each character in the input string
# if character == ")"
# initialize a 'to_compute' stack
# while last char in stack is NOT '('
# pop from stack and push onto the 'to_compute' stack
# pop the '(' from the stack
# stack << calculate(to_compute)
# else
# push onto stack
c = CarProblemsController
c.instance_methods.include?(:before_filter)
=> false
c.methods.include?(:before_filter)
=> true
class << c
p self.instance_methods.include?(:before_filter)
class FunkyHash < Hash
def initialize(hash)
@hash = hash
@hash.each do |k, v|
self.class.send(:define_method, k) { v }
end
create_hash
end
def create_hash
@awillborn
awillborn / jquery_example.html
Created January 9, 2014 21:52 — forked from dbc-challenges/jquery_example.html
Intro to jQuery for Phase 0
<!DOCTYPE html>
<html>
<head>
<title>DOM manipulation with jQuery</title>
<!-- Add a link to jQuery CDN here script here -->
<script type="text/javascript" src="jquery_example.js"></script>
</head>
<body>
@awillborn
awillborn / 0.2.1-boggle_class_from_methods.rb
Last active December 30, 2015 04:39 — forked from dbc-challenges/0.2.1-boggle_class_from_methods.rb
phase 0 unit 2 week 1 boggle class challenge
class BoggleBoard
attr_reader :board
def initialize(board)
@board = board
puts board
end
def create_word(*coords)