{
"id": "251533197-CE3BEA67AA7ADB52D50206C44F9FA5DB",
"title": "Cable News Network",
"short_name": "CNN"
}
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
#!/usr/bin/env ruby | |
require 'open3' | |
require 'optparse' | |
script_name = File.basename($0) | |
options = {} | |
option_parser = OptionParser.new do |opts| | |
opts.banner = <<-HEREDOC | |
Usage: |
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
define(['view'], function(View){ | |
return View.sub('ItemView', function(){ | |
this.domEvent('click', 'button', 'selected') | |
}) | |
}) |
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
define(['view'], function(View){ | |
return View.sub('ItemView', function(){ | |
this.domEvent('click', 'button', 'selected') | |
}) | |
}) |
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
### EXAMPLE: USING DRAGONFLY WITH S3 ON HEROKU ### | |
#### CURRENT API ##### | |
# in initializer file | |
require 'dragonfly' | |
app = Dragonfly[:images] | |
app.configure_with(:imagemagick) |
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 Server | |
def call(env) | |
EM.system 'sayBobInOneSecond' do |result, status| | |
env['async.callback'].call [200, {'Content-Type' => 'text/plain'}, [result]] | |
end | |
throw :async | |
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
#!/usr/bin/env ruby | |
if ARGV.length != 1 | |
puts "Usage:" | |
puts " colour red" | |
puts "or" | |
puts " colour '#00ffaa' # NOTE THE QUOTES" | |
puts "or" | |
puts " colour rgb(255,0,0)" | |
exit |
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 'fiber' | |
module Stuff | |
class << self | |
def system_call_1 | |
f = Fiber.current | |
EM.system 'delayedEcho dogs' do |result, status| | |
f.resume result | |
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
(function($){ | |
// Simple tabs | |
// Example markup: | |
// | |
// <div data-tabs="tabs"> | |
// <ul> | |
// <li data-tabs="title" data-tabs-id="fish">...</li> | |
// <li data-tabs="title" data-tabs-id="egg">...</li> | |
// </ul> |
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
# Helper file | |
class Block < BlockHelpers::Base | |
def initialize(opts={}) | |
@opts = opts | |
end | |
def display(body) | |
content_tag :div, body, :class => "block #{@opts[:class]}" |
NewerOlder