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
use std::str; | |
fn main() { | |
// the string literal is actually a &str (slice ref to a String) that is "owned" by the | |
// runtime when it starts, it's shipped as part of the binary as pre-allocated and readonly | |
// memory and is not on the heap. | |
// it needs to be converted to a String so it can be placed on the heap, and borrowed and | |
// resized if needed. This is the job of .to_string(). It might seem strange to take a string | |
// and immediately convert it to a String, but basically you need to ship it from "const" land |
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 Moo | |
def self.included(base) | |
base.extend(ClassMethods) | |
end | |
def jump! | |
trigger(:before_jump) | |
puts 'JUMP' | |
trigger(:after_jump) | |
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 python | |
import datetime | |
import flask | |
import redis | |
import os | |
app = flask.Flask(__name__) | |
app.secret_key = 'asdf' | |
red = redis.Redis(host=os.environ['REDIS_HOST'], port=6379, db=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
# Add truecolor support{{{ | |
set-option -sa terminal-overrides ",xterm*:Tc" | |
# color 256! | |
set -g default-terminal "screen-256color" | |
# }}} | |
# enter copy mode on any C-Up{{{ | |
# bind -n C-Up copy-mode -eu | |
# }}} |
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/perl -w | |
my $dict = "/usr/share/dict/words"; | |
my $maxlen = shift @ARGV; | |
my $wordmin = 3; | |
my $wordmax = 12; | |
my $num_words = 4; | |
my $skip_possessives = 1; # db contains 's forms for every noun |
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
request = require 'request' | |
logger = require('winston') | |
lineReader = require('line-reader') | |
q = require 'q' | |
now = new Date | |
first_time = null | |
host = 'hydra-staging.herokuapp.com' |
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
14:45:40 - ERROR - Cannot decode JSON from PhantomJS runner: 795: unexpected token at 'Unsafe JavaScript attempt to access frame with URL about:blank from fra | |
me with URL file:///Users/samoeba/.gem/ruby/2.0.0/gems/guard-jasmine-1.19.0/lib/guard/jasmine/phantomjs/guard-jasmine.js. Domains, protocols and ports must ma | |
tch. | |
> [#50A8AF5DD37C] | |
> [#50A8AF5DD37C] Unsafe JavaScript attempt to access frame with URL about:blank from frame with URL file:///Users/samoeba/.gem/ruby/2.0.0/gems/guard-jasmine- | |
1.19.0/lib/guard/jasmine/phantomjs/guard-jasmine.js. Domains, protocols and ports must match. | |
> [#50A8AF5DD37C] |
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
varnishtest "#1030" | |
server s1 { | |
rxreq | |
expect req.url == "/test" | |
txresp | |
rxreq |
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
--- /Users/samoeba/Downloads/123d2pKhY1JNsNsc0bzw4L_38.vcl 2014-10-03 08:22:03.000000000 -0400 | |
+++ /Users/samoeba/Downloads/123d2pKhY1JNsNsc0bzw4L_39.vcl 2014-10-03 13:49:59.000000000 -0400 | |
@@ -421,7 +421,7 @@ | |
# Header rewrite Whitelist Querystring : 10 | |
- set req.url = regsuball(req.url, "(^|[\\?&]+)([^&\\/=]+(?:(&|$))|(?!_escaped_fragment_|brand|branch|type|min_msrp|max_msrp|_type|keywords|page|per_page|tags|name|order_by|adid|return_url|event|classifications|zip|website_ids\\b)[^&\\/=]+=[^&]+)", "&"); | |
+ set req.url = regsuball(req.url, "(^|[?&]+)([^&/=]+(?:(&|$))|(?!_escaped_fragment_|brand|branch|type|min_msrp|max_msrp|_type|keywords|page|per_page|tags|name|order_by|adid|return_url|event|classifications|zip|website_ids)[^&/=]+=[^&]+)", "&"); | |
NewerOlder