Skip to content

Instantly share code, notes, and snippets.

@lsegal
lsegal / setup.js
Created March 19, 2014 18:23
Bug in ESLint checking of .eslintrc files in subdirectories. Run 'node setup.js' then 'eslint lib'
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;');
$ 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:
@lsegal
lsegal / config.ru
Last active August 29, 2015 13:58 — forked from anonymous/config.ru
require_relative 'boot'
db = Sequel.connect(ENV['DATABASE_URL'])
Urls.attach_db(db[:urls])
run UrlShortener
module Skylight
if native?
class Hello
# Foo
def foo
x if true
end
end
end
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(...);
}
public class Test {
public static void main(String[] args) {
int x;
float y = 2.345f;
x = 2.345f;
x = y;
}
}
import std;
backend default { .host = "app1.rubydoc.org"; .port = "8080"; }
acl purge {
"localhost";
"app1.rubydoc.org"; // and the backend server
}
sub vcl_recv {
////////////////////////////////////////////////////////////////////////////////
// READABLE STREAM IMPLEMENTATION //
////////////////////////////////////////////////////////////////////////////////
var https = require('https');
var streams = require('stream');
function createRequest(bucket, key, callback) {
return {
send: function() {
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}:"
$ 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