Skip to content

Instantly share code, notes, and snippets.

@lsegal
lsegal / ios8-safari-if-modified-since-bug.html
Last active August 29, 2015 14:07
iOS 8 Safari If-Modified-Since caching bug
<!--
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) \
loadedInterfaceName = "Remote";
interfaceOrientation = "portrait";
destinationManager.selectIPAddressAndPort("192.168.0.10", "5000");
pages = [ [
// window buttons
{
name: "win1",
type: "Button",
$ 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
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}:"
////////////////////////////////////////////////////////////////////////////////
// READABLE STREAM IMPLEMENTATION //
////////////////////////////////////////////////////////////////////////////////
var https = require('https');
var streams = require('stream');
function createRequest(bucket, key, callback) {
return {
send: function() {
@lsegal
lsegal / anagram.js
Last active December 28, 2017 23:46 — forked from stevepm/anagram.js
function anagram(word) {
var originalWord = wordObject(word);
return {
matches: function(wordArray) {
if (typeof wordArray === 'string'){
wordArray = Array.prototype.slice.call(arguments);
}
var wordMatches = [];
import std;
backend default { .host = "app1.rubydoc.org"; .port = "8080"; }
acl purge {
"localhost";
"app1.rubydoc.org"; // and the backend server
}
sub vcl_recv {
public class Test {
public static void main(String[] args) {
int x;
float y = 2.345f;
x = 2.345f;
x = y;
}
}
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(...);
}
module Skylight
if native?
class Hello
# Foo
def foo
x if true
end
end
end