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 "action_controller/railtie" | |
class TheSimplestRailsApp < Rails::Application | |
config.secret_token = "ef224177dc6ddcaabffafdbaa50cdb173eb744932073d" | |
config.eager_load = false | |
initialize! | |
routes.draw do | |
root to: "hello#world" | |
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
killall Terminal Google\ Chrome Sublime\ Text\ 2 Remote\ Desktop\ Message Finder | |
cd ~ | |
find . ! -name .rubies ! -name .gem ! -name .Trash ! -name Code ! -name Desktop ! -name Documents ! -name Downloads ! -name Library ! -name Movies ! -name Music ! -name Pictures ! -name Public -maxdepth 1 -type d -print | xargs rm -rf | |
rm -rf ~/Code/* ~/Desktop/* ~/Documents/* ~/Downloads/* ~/Movies/* ~/Pictures/* ~/Public/* | |
rm ~/* |
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 Object | |
def _if(object) | |
object.class != FalseClass && !object.nil? | |
end | |
end | |
class TrueClass | |
def then | |
yield | |
self |
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 Integer | |
def in_words | |
up_to_twenty = { 0 => "\b", | |
1 => "one", | |
2 => "two", | |
3 => "three", | |
4 => "four", | |
5 => "five", | |
6 => "six", | |
7 => "seven", |
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 Integer | |
def in_words | |
if self < 20 | |
{1 => "one", | |
2 => "two", | |
3 => "three", | |
4 => "four", | |
5 => "five", | |
6 => "six", | |
7 => "seven", |
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 Integer | |
def in_words | |
if self < 20 | |
{0 => "\b", | |
1 => "one", | |
2 => "two", | |
3 => "three", | |
4 => "four", | |
5 => "five", | |
6 => "six", |
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 Integer | |
def in_words | |
if self < 20 | |
{0 => "\b", | |
1 => "one", | |
2 => "two", | |
3 => "three", | |
4 => "four", | |
5 => "five", | |
6 => "six", |
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 Integer | |
def in_words | |
if self < 20 | |
{0 => "\b", 1 => "one", 2 => "two", 3 => "three", 4 => "four", 5 => "five", 6 => "six", 7 => "seven", 8 => "eight", 9 => "nine", 10 => "ten", 11 => "eleven", 12 => "twelve", 13 => "thirteen", 14 => "fourteen", 15 => "fifteen", 16 => "sixteen", 17 => "seventeen", 18 => "eighteen", 19 => "nineteen"}[self] | |
elsif self < 100 | |
"#{{20 => "twenty", 30 => "thirty", 40 => "forty", 50 => "fifty", 60 => "sixty", 70 => "seventy", 80 => "eighty", 90 => "ninety"}[self - (self % 10)]} #{(self % 10).in_words}" | |
elsif self < 1_000 | |
"#{(self / 100).in_words} hundred #{(self % 100).in_words}" | |
else | |
{10 ** 12 => "trillion", 10 ** 9 => "billion", 10 ** 6 => "million", 10 ** 3 => "thousand"}.each { |number, word| return "#{(self / number).in_words} #{word} #{(self % number).in_words}" if (self / number) >= 1 && (self / number) < 1_000 } |
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 Integer | |
def in_words | |
if self < 20 | |
{0 => "\b", | |
1 => "one", | |
2 => "two", | |
3 => "three", | |
4 => "four", | |
5 => "five", | |
6 => "six", |
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 Integer | |
def in_words | |
if self < 20 | |
{0 => "\b", | |
1 => "one", | |
2 => "two", | |
3 => "three", | |
4 => "four", | |
5 => "five", | |
6 => "six", |
OlderNewer