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
%% Disable SSLv3.0 support | |
[ | |
{ssl, [{versions, ['tlsv1.2', 'tlsv1.1', tlsv1]}]}, | |
{rabbit, [ | |
{ssl_listeners, [5671]}, | |
{ssl_options, [{cacertfile,"/path/to/ca_certificate.pem"}, | |
{certfile, "/path/to/server_certificate.pem"}, | |
{keyfile, "/path/to/server_key.pem"}, | |
{versions, ['tlsv1.2', 'tlsv1.1', tlsv1]} | |
]} |
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
[ | |
{ssl, [{versions, ['tlsv1.2', 'tlsv1.1', tlsv1]}, | |
{ciphers, [{dhe_rsa,aes_256_cbc,sha}]} | |
]}, | |
{rabbit, [ | |
{ssl_listeners, [5672]}, | |
{tcp_listeners, []}, | |
{ssl_options, [{cacertfile,"/path/to/cacert.pem"}, | |
{certfile,"/path/to/server.pem"}, |
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
(ns test) | |
(defn try-times | |
"Try executing a thunk `retries` times." | |
[retries thunk] | |
(if-let [res (try | |
[(thunk)] | |
(catch Exception e ; can be any exception | |
(when (zero? retries) | |
(throw e))))] |
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
Hey <github-handle> | |
Thanks that you run your test on Travis-CI. | |
Just to let you know: your tests failing because you haven't included rake in your Gemfile. | |
Please be so kind to add rake and your tests should run as you expect. | |
Thanks again for using Travis-CI | |
your Travis-Team |
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
~/projects/jruby $ ant -q -Djruby.default.ruby.version=1.9 | |
[echo] Updating Constants.java | |
[echo] ...using git revision = 19f613b, tzdata = 2010k | |
[javac] warning: [options] bootstrap class path not set in conjunction with -source 1.5 | |
[javac] 1 warning | |
[apt] Since compiler setting isn't classic or modern, ignoring fork setting. | |
[apt] Since compiler setting isn't classic or modern, ignoring fork setting. | |
[jar] Warning: selected jar files include a META-INF/INDEX.LIST which will be replaced by a newly generated one. | |
BUILD SUCCESSFUL |
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
# Workaround for IO.popen.readlines being allowed to block indefinitely even if | |
# wrapped in a Timeout::timeout call. | |
# | |
# Test case: | |
# $ time jruby -rtimeout -e "timeout(1) { IO.popen('sleep 10').readlines }" | |
require 'jruby' | |
module Timeout | |
def self.timeout(sec, klass=nil) | |
return yield(sec) if sec == nil or sec.zero? |
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
(with-collection "docs" | |
(find { :inception_year { $lt 2000 $gte 2011 } }) | |
(fields { :inception_year 1 :name 1 }) | |
(skip 10) | |
(limit 20) | |
(batch-size 50) | |
(hint "my-index-name") | |
(snapshot)) |
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
// Modified SpamLord.java to call clojure code | |
public List<Contact> processFile(String fileName, BufferedReader input) { | |
List<Contact> contacts = new ArrayList<Contact>(); | |
// for each line | |
Matcher m; | |
String email; | |
try { | |
List results = new spamlord().process(input); |
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
//Pinstats. | |
//Fetch the pinterest front page. Extract all the name elements | |
//and keep track of the gender of what you find | |
package main | |
import ( | |
"code.google.com/p/go-html-transform/html/transform" | |
"fmt" |
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
Latency Comparison Numbers | |
-------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns | |
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms | |
Read 4K randomly from SSD* 150,000 ns 0.15 ms |
OlderNewer