JSConf.eu opening song - JavaScript Will Listen - Bella Morningstar
- Plask - Dean McNamee
- Plask
(require 'cl) | |
(defconst count-syllables-negative | |
'("cial" "tia" "cius" "cious" "giu" "ion" "iou" "sia$" ".ely$")) | |
(defconst count-syllables-positive | |
'("ia" "riet" "dien" "iu" "io" "li" | |
"[aeiouym]bl$" | |
"[aeiou]\\{3\\}" | |
"^mc" |
(ns pallet.cache.impl | |
"An implementation namespace for pallet.cache") | |
(defprotocol CacheProtocolImpl | |
"Cache implementation interface." | |
(lookup [cache e] [cache e default] | |
"Retrieve the value associated with `e` if it exists") | |
(has? [cache e] | |
"Checks if the cache contains a value associtaed with `e`")) |
/* See: http://0x10c.com/doc/dcpu-16.txt */ | |
function hex(n) { | |
return '0x' + n.toString(16); | |
} | |
function disassemble (code) { | |
var PC = 0; | |
var operand = function (bits) { |
package core | |
import ( | |
"net/http" | |
) | |
// the Request struct wraps the http.Request struct, providing a slice of | |
// strings representing the positional arguments found in a url pattern, and a | |
// map[string]string called kwargs representing the named parameters captured | |
// in url parsing. |
;; (mcase subject-expr (pattern action) ...) | |
(defmacro mcase (subject &rest clauses) | |
`(funcall (mlambda ,@clauses) ,subject)) | |
;; (mlambda (pattern action) ...) | |
(defmacro mlambda (&rest clauses) | |
(if (null clauses) | |
'(lambda (x) (match-error x)) | |
(let ((subject (gensym)) (fail (gensym))) | |
`(lambda (,subject) |
#!/bin/bash | |
FILE=$1 | |
if [ -d $FILE ]; then | |
DIR=$FILE | |
else | |
DIR=`dirname $FILE` | |
fi | |
function parse_git_branch { |
;; See http://okmij.org/ftp/continuations/implementations.html#dynamic-wind | |
;; and http://axisofeval.blogspot.com/2012/08/delimited-continuations-do-dynamic-wind.html | |
;; Slight trick here: use identity of yield-record-tag function as the actual tag | |
(define (yield-record-tag) yield-record-tag) | |
(define (make-yield-record v k) | |
(list yield-record-tag v k)) | |
;; Yield simply aborts up to the generator's caller, delivering to it | |
;; the yielded value and the continuation for resuming after the call |
#!/usr/bin/env ruby | |
class MRISC | |
def run(code) | |
tokens = code.gsub(/(\*.*?\*)|[^a-z0-9,-;@\._]/,'').split(';') | |
@vars,stack,i = {:_pc=>-1,:_oc=>0},[],0 | |
tokens.map!{|t| t.chars.first=='@' ? (@vars[t.to_sym]=i-1;nil) : (i+=1;t.split(',').map{|e|numeric?(e) ? e.to_i : e.to_sym})}.compact! | |
while @vars[:_pc] < tokens.size-1 | |
@vars[:_pc] += 1 | |
@vars[:_oc] += 1 |