The Strange Loop 2014
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
--- Starting Benchmarks -------------------------------------------------------- | |
ETA: 30 benchmarks to run = 300 seconds minimum. | |
--- Template Benchmark @Wed Feb 11 12:11:15 2015 ------------------------------- | |
HT - HTML::Template (2.95) | |
HTE - HTML::Template::Expr (0.07) | |
MoTe - Mojo::Template () | |
TAHT - Template::Alloy (1.020) in HTML::Template mode | |
TATT - Template::Alloy (1.020) in Template::Toolkit mode | |
TATT_P - Template::Alloy (1.020) in Template::Toolkit mode (compile to | |
perl) |
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
new Region() | |
.publishedDocuments() | |
.query(function(q){ | |
q.join('regions', 'regions.id', '=', 'documentRegions.region_id'); | |
q.whereIn('regions.id', regionIds); | |
q.where('publishedDocuments.updated_at', '>=', new Date(timestamp)); | |
}) | |
.fetchAll({withRelated: [ | |
'publishedDocuments.images', | |
'publishedDocuments.ecareSections', |
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
(require web-server/servlet | |
web-server/servlet-env) | |
(define (my-app req) | |
(response/xexpr | |
`(html (head (title "Hello world!")) | |
(body (p "Hey out there!"))))) | |
(define port (or (and (getenv "PORT") | |
(string->number (getenv "PORT"))) |
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
#lang racket | |
(define (set-interval interval fn) | |
(thread | |
(lambda () | |
(let loop () | |
(fn) | |
(sleep interval) | |
(loop))))) |
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
#lang racket | |
(require json) | |
(require net/http-client) | |
(define (4chan-data board x) | |
(let*-values | |
([(status headers res) | |
(http-sendrecv "a.4cdn.org" | |
(string-append "/" board "/" x ".json"))] | |
[(json) (read-string 1048576 res)] |
For those of you want to contribute to the development of WebGUI 8, here are a few tips to help you get started.
First, fork AlliumCepa/webgui.
This will create a fork of webgui owned by your github account.
export user=you
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
Generating a project called test-project based on the 'default' template. | |
To see other templates (app, lein plugin, etc), try `lein help new`. | |
Times for 2.4.0-RC | |
Downloading Leiningen to /Users/beppu/.lein/self-installs/leiningen-2.4.0-RC-standalone.jar now... | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 13.1M 100 13.1M 0 0 5132k 0 0:00:02 0:00:02 --:--:-- 5133k | |
real 0m5.887s | |
user 0m3.230s |
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
# Think of this as a debounce that remembers intermediate calls and summarizes them instead of throwing them away. | |
# | |
# @param {Function} initial-fn function that returns initial-state for use with fold and combiner-fn | |
# @param {Function} combiner-fn given an array of arrays of function arguments, fold them into a value that can be used by final-fn | |
# @param {Function} final-fn function to run after nothing has happend for longer than delay milliseconds | |
# @param {Number} delay milliseconds to wait for inactivity before running final-fn | |
export burst = (initial-fn, combiner-fn, final-fn, delay) -> | |
ax = [] | |
accumulating = false | |
wait = null |
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
[img]http://i.imgur.com/bDzzx8t.jpg[/img] | |
[img]http://i.imgur.com/xWS5Obr.jpg[/img] | |
[img]http://i.imgur.com/ALdQr1b.jpg[/img] | |
[img]http://i.imgur.com/Jx8Km2W.jpg[/img] | |
[img]http://i.imgur.com/dTfawmq.jpg[/img] |