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
if false | |
wtf = :wtf | |
end | |
# I would expect this to error | |
wtf |
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
class Die | |
def roll | |
rand(1..6) | |
end | |
end | |
die1 = Die.new | |
die2 = Die.new | |
# puts dice_roll = die1.roll + die2.roll | |
first_roll = true |
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
# Original method | |
#def process2(input) | |
# if input == 'q' | |
# Goodbye.new.exec | |
# elsif input == 'tweet' | |
# Tweeter.new.exec | |
# elsif input == 'dm' | |
# Message.new.exec | |
# elsif input == 'help' |
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
# Original method | |
#def process(input) | |
# if input == 'q' | |
# puts 'Goodbye' | |
# elsif input == 'tweet' | |
# puts 'tweeting' | |
# elsif input == 'dm' | |
# puts 'direct messaging' | |
# elsif input == 'help' |
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
require 'prime' | |
require 'pp' | |
def each_multiple(base, boundary) | |
multiplier = 1 | |
while (product = base * multiplier) < boundary | |
# puts "#{prime}: totients[#{product}] -= #{multiplier}" | |
yield product, multiplier | |
multiplier += 1 | |
end |
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
#placeholder |
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
# Inspiration: Franklin Webber's page_url Jekyll plugin | |
# | |
# Usage: | |
# {% internal_link folder/filename %} | |
# note: do not include filename extension | |
# | |
# Example markdown usage: | |
# [Link to cool page]({% internal_link sessions/ruby_bootstrap %}) | |
# |
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
class NilClass | |
def to_s | |
nil | |
end | |
end | |
class Person | |
def initialize(options) | |
@first_name = options[:first_name] | |
@middle_name = options[:middle_name] |
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
#original attribution https://gist.github.com/alexspeller/6251054 & https://gist.github.com/stevekane/6356006 | |
App.ClickElsewhereMixin = Ember.Mixin.create | |
#use this method hook to define your desired behavior | |
onClickElsewhere: Ember.K | |
#bound version of our instance method | |
clickHandler: Em.computed -> | |
Em.run.bind @, 'onClickElsewhere' |
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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle' | |
}); |