This file contains hidden or 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
# config/application.rb | |
module RailsApplicationName | |
class Application < Rails::Application | |
... | |
console do | |
ARGV.push "-r", root.join("lib/console.rb") | |
end | |
end | |
end |
This file contains hidden or 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
echo '############## | |
0.0.0.0 www.reddit.com | |
:: www.reddit.com | |
#############' >> /etc/hosts |
This file contains hidden or 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
cors | |
credentials true | |
headers accept, authorization, content-type, origin, referer, x-csrf-token | |
methods GET, PUT, POST, HEAD, DELETE | |
origins * | |
couch_httpd_auth | |
require_valid_user true |
This file contains hidden or 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
let colors = [UIColor.turquoiseColor(), | |
UIColor.greenSeaColor(), | |
UIColor.emerlandColor(), | |
UIColor.nephritisColor(), | |
UIColor.peterRiverColor(), | |
UIColor.belizeHoleColor(), | |
UIColor.amethystColor(), | |
UIColor.wisteriaColor(), |
This file contains hidden or 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
file_content = File.open File.join(Rails.root, 'config', 'settings.yml') | |
Settings = OpenStruct.new(YAML.load(file_content)[Rails.env]) |
This file contains hidden or 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
// Playground - noun: a place where people can play | |
import Cocoa | |
var str = "Hello, playground" | |
var dictionary = [1 : "1",2 : "2" ,3 : "3"] | |
for (a , b) in dictionary { | |
println(String(a) + b) | |
} |
This file contains hidden or 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
//TODO | |
//https://developers.google.com/apps-script/managing_triggers_programmatically | |
function moveDelayedMessages() { | |
receiveEmails("Delayed Messages"); | |
} | |
// receiveEmails() will take all threads in labelname (Default: 'Delayed messages') | |
// and place them into the mailbox. The intent is for a delayed retrieval of |
This file contains hidden or 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
#Metaprogramming | |
class Meta | |
def create_method(name, block) | |
self.class.send(:define_method, name, block) | |
end | |
end | |
m = Meta.new | |
method_body = -> { puts "hello no args" } | |
another_method_body = lambda { |text| puts "args are: #{text}" } |