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
(define (s:reify thunk) | |
(reset-at 'state (s:return (thunk)))) | |
(define (s:reflect m) | |
(shift-at 'state k (s:>>= m k))) | |
(define (r:reify thunk) | |
(reset-at 'reader (return (thunk)))) | |
(define (r:reflect m) |
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
#!r6rs | |
;; Really simple generators using delimited continuations | |
(library (toys simple-generators) | |
(export make-generator | |
up-from | |
list->generator) | |
(import (rnrs) | |
(spells delimited-control)) |
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-modules (ice-9 control) | |
(rnrs hashtables) | |
(web server) | |
(sxml simple) | |
(web response) | |
(web request) | |
(web uri) | |
(ice-9 match)) | |
;; utilities |
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 ruby | |
require 'net/telnet' | |
cache_dump_limit = 100 | |
localhost = Net::Telnet::new("Host" => "localhost", "Port" => 11211, "Timeout" => 3) | |
slab_ids = [] | |
localhost.cmd("String" => "stats items", "Match" => /^END/) do |c| | |
matches = c.scan(/STAT items:(\d+):/) | |
slab_ids = matches.flatten.uniq | |
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
#!/bin/sh | |
set -e | |
# Ping FCGI server. Uses cgi-fcgi program from libfcgi library. | |
# Retrieves the root path (/) from host:port specified on command line. | |
if [ -z "$1" ] ; then | |
echo "Usage: $0 host:port|path/to/socket" >&2 | |
exit 1 | |
fi |
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 doHash(str, seed) { | |
var m = 0x5bd1e995; | |
var r = 24; | |
var h = seed ^ str.length; | |
var length = str.length; | |
var currentIndex = 0; | |
while (length >= 4) { | |
var k = UInt32(str, currentIndex); | |
NewerOlder