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
var fs = require('fs'); | |
fs.mkdirSync('lib'); | |
fs.mkdirSync('lib/foo'); | |
// turn off camelcase check for .eslintrc | |
fs.writeFileSync('.eslintrc', '{ "rules": { "camelcase": 0 } }'); | |
// this file should not raise error, not inside of lib/foo/* | |
fs.writeFileSync('lib/foo.js', 'var not_camelcase = 0;'); |
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
$ grep -r ':nodoc:' . | |
Binary file ./.git/objects/pack/pack-c68551034ab92084bc1c3bf0bbca075bcd59b599.pack matches | |
./actionmailer/lib/action_mailer/base.rb: def _protected_ivars # :nodoc: | |
./actionmailer/lib/action_mailer/base.rb: private_class_method :new #:nodoc: | |
./actionmailer/lib/action_mailer/base.rb: def deliver_mail(mail) #:nodoc: | |
./actionmailer/lib/action_mailer/base.rb: def respond_to?(method, include_private = false) #:nodoc: | |
./actionmailer/lib/action_mailer/base.rb: def set_payload_for_mail(payload, mail) #:nodoc: | |
./actionmailer/lib/action_mailer/base.rb: def method_missing(method_name, *args) # :nodoc: | |
./actionmailer/lib/action_mailer/base.rb: def process(method_name, *args) #:nodoc: | |
./actionmailer/lib/action_mailer/base.rb: class NullMail #:nodoc: |
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_relative 'boot' | |
db = Sequel.connect(ENV['DATABASE_URL']) | |
Urls.attach_db(db[:urls]) | |
run UrlShortener |
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
module Skylight | |
if native? | |
class Hello | |
# Foo | |
def foo | |
x if true | |
end | |
end | |
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
var ec2east = new AWS.EC2({region: 'us-east-1'}); | |
var ec2west = new AWS.EC2({region: 'us-west-2'}); | |
for (some stuff) { | |
if (instance is master) { | |
ec2east.runInstances(...); | |
} else if (instance is a backup) { | |
// run in secondary AZ | |
ec2west.runInstances(...); | |
} |
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
public class Test { | |
public static void main(String[] args) { | |
int x; | |
float y = 2.345f; | |
x = 2.345f; | |
x = y; | |
} | |
} |
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 std; | |
backend default { .host = "app1.rubydoc.org"; .port = "8080"; } | |
acl purge { | |
"localhost"; | |
"app1.rubydoc.org"; // and the backend server | |
} | |
sub vcl_recv { |
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
//////////////////////////////////////////////////////////////////////////////// | |
// READABLE STREAM IMPLEMENTATION // | |
//////////////////////////////////////////////////////////////////////////////// | |
var https = require('https'); | |
var streams = require('stream'); | |
function createRequest(bucket, key, callback) { | |
return { | |
send: function() { |
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 Foo | |
def foo; "abc" end | |
# this default param should resolve at runtime to the #foo method call | |
def run(foo = foo) | |
p foo # print shadowed local var defaulting to attr value | |
end | |
end | |
puts "Testing #{RUBY_VERSION}:" |
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
$ rvm use 1.8.7 | |
$ irb | |
>> class Foo; def foo; "abc" end; def run; foo=foo; p foo; end end | |
=> nil | |
>> Foo.new.foo | |
=> "abc" | |
$ rvm use 2.2.0 | |
$ irb | |
>> class Foo; def foo; "abc" end; def run; foo=foo; p foo; end end | |
=> :run |
OlderNewer