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
@@ -596,8 +597,8 @@ | |
dataToSignLen = SSL_SHA1_DIGEST_LEN + SSL_MD5_DIGEST_LEN; | |
hashOut.data = hashes; | |
hashOut.length = SSL_MD5_DIGEST_LEN; | |
- | |
- if ((err = ReadyHash(&SSLHashMD5, &hashCtx, ctx)) != 0) | |
+ | |
+ if ((err = ReadyHash(&SSLHashMD5, &hashCtx)) != 0) | |
goto fail; | |
if ((err = SSLHashMD5.update(&hashCtx, &clientRandom)) != 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
Start a in-memory S3-compatible (kinda...) server. | |
Uses https://github.com/csm/s4 |
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
(defn distinct-by | |
"Like distinct, but uses f to consider what duplicate values are." | |
([f] | |
(fn [rf] | |
(let [seen (volatile! #{})] | |
(fn | |
([] (rf)) | |
([result] (rf result)) | |
([result input] | |
(let [v (f 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
(import '[io.netty.util Recycler]) | |
(defprotocol Recyclable | |
(recycle! [this] "Recycles this object.")) | |
(defprotocol Init | |
(init! [this values])) | |
(defmacro defrecyclable | |
[name fields & {:keys [max-capacity] :or {max-capacity 8096}}] |
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
(defn js-engine | |
[] | |
(if-let [engine (.getEngineByName (ScriptEngineManager.) "JavaScript")] | |
engine | |
(throw (Exception. "no JavaScript engine found. Sorry")))) | |
(defn run-slides-js | |
[s] | |
(let [engine (js-engine) | |
script (str "(function() {\n" |
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 collections | |
import random | |
i = 0 | |
n = 0 | |
d = [collections.OrderedDict()] | |
def lin(k): | |
global i |
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
Command line invocation: | |
/Users/csm/Library/Developer/Xcode/DerivedData/Magni-fofbzndvghoaitbkravzhufuwzey/Build/Products/Debug/X\ Y.app/Contents/Resources/CouchDB/Versions/1.2/Resources/bin/erl +Bd -noinput -os_mon start_memsup false start_cpu_sup false disk_space_check_interval 1 disk_almost_full_threshold 1 -sasl errlog_type error +K true +A 4 -env ERL_LIBS /Users/csm/Library/Developer/Xcode/DerivedData/Magni-fofbzndvghoaitbkravzhufuwzey/Build/Products/Debug/X\ Y.app/Contents/Resources/CouchDB/Versions/1.2/Resources/lib/couchdb/erlang/lib -couch_ini /Users/csm/Library/Developer/Xcode/DerivedData/Magni-fofbzndvghoaitbkravzhufuwzey/Build/Products/Debug/X\ Y.app/Contents/Resources/CouchDB/Versions/1.2/Resources/etc/couchdb/default.ini /Users/csm/Library/Developer/Xcode/DerivedData/Magni-fofbzndvghoaitbkravzhufuwzey/Build/Products/Debug/X\ Y.app/Contents/Resources/CouchDB/Versions/1.2/Resources/etc/couchdb/local.ini /Users/csm/Library/Application Support/Memeo\ C1/local.ini -s couch | |
Output: | |
{"init terminati |
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
# RE: http://xkcd.com/936/ | |
import random | |
n = 4 | |
f = open('/usr/share/dict/words', 'r') | |
w = f.readlines() | |
print " ".join(map(lambda x : x.strip(), random.sample(w, n))) |
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
p2p7: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500 | |
ether XX:XX:XX:XX:XX:XX | |
inet6 fe80::1855:caff:fef2:5bc7%p2p7 prefixlen 64 scopeid 0x8 | |
media: autoselect | |
status: active |
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
p2p0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 2304 | |
ether XX:XX:XX:XX:XX:XX | |
media: autoselect | |
status: inactive |
NewerOlder