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
<!-- | |
iOS 8 Safari If-Modified-Since caching bug: | |
Safari sends an invalid If-Modified-Since header on PUT requests if a prior | |
GET request on the same URI returns a Last-Modified header and the "upload" | |
property is accessed on the XHR object prior to calling .send(): | |
PUT /path | |
If-Modified-Since: Wed, 08 Oct 2014 22:20:57 GMT | |
User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 10_9_5 like Mac OS X) \ |
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
loadedInterfaceName = "Remote"; | |
interfaceOrientation = "portrait"; | |
destinationManager.selectIPAddressAndPort("192.168.0.10", "5000"); | |
pages = [ [ | |
// window buttons | |
{ | |
name: "win1", | |
type: "Button", |
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 |
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
//////////////////////////////////////////////////////////////////////////////// | |
// 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
function anagram(word) { | |
var originalWord = wordObject(word); | |
return { | |
matches: function(wordArray) { | |
if (typeof wordArray === 'string'){ | |
wordArray = Array.prototype.slice.call(arguments); | |
} | |
var wordMatches = []; |
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
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
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
module Skylight | |
if native? | |
class Hello | |
# Foo | |
def foo | |
x if true | |
end | |
end | |
end |