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 :fare-matcher) | |
;; Clojure or ML's function syntax style defun | |
(defmacro defunction (name &body body) | |
(flet ((match-clause (clause) | |
(cons `(list ,@(car clause)) (cdr clause)))) | |
(let ((args (gensym))) | |
`(defun ,name (&rest ,args) | |
(fare-matcher:ematch ,args |
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 'oauth/consumer' | |
require 'net/http/post/multipart' | |
OAuth::VERSION = 1.0 | |
consumer = OAuth::Consumer.new('consumer_key', 'consumer_secret', | |
:site => 'http://provider.example.com', | |
:request_token_path => '/request_token', | |
:authorize_path => '/authorize', | |
:access_token_path => '/access.token') |
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 static java.lang.System.*; | |
public class WhatIsJavaLibraryPath { | |
public static void main(String[] args) { | |
out.println(getProperty("java.library.path")); | |
} | |
} |
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
(* cat.ml *) | |
(* simple cat command in O'Caml *) | |
open Sys | |
open Array | |
open List | |
let print_channel in_channel = | |
let rec iter _ = | |
print_endline (input_line in_channel); |
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
;; Flymake Ocaml | |
(add-to-list 'exec-path "~/bin") | |
(defun flymake-ocaml-init () | |
(flymake-simple-make-init-impl | |
'flymake-create-temp-with-folder-structure nil nil | |
(file-name-nondirectory buffer-file-name) | |
'flymake-get-ocaml-cmdline)) | |
(defun flymake-get-ocaml-cmdline (source base-dir) | |
(list "ocaml_flycheck.pl" | |
(list source base-dir))) |
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
;;; The following lines added by ql:add-to-init-file: | |
#-quicklisp | |
(let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp" | |
(user-homedir-pathname)))) | |
(when (probe-file quicklisp-init) | |
(load quicklisp-init))) | |
;;; make cffi to dlopen homebrewed libraries | |
(require :cffi) |
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
$ cat > kiku.c | |
#include <pthread.h> | |
char c;f(){while(1)c=~getchar();}main(t,p){pthread_create(&p,NULL,f,NULL);for(t=0;;t++)putchar(t>>~c|t>>5|t>>1000-c|t>>c);} | |
$ make kiku | |
cc kiku.c -o kiku | |
kiku.c: In function ‘main’: | |
kiku.c:2: warning: passing argument 1 of ‘pthread_create’ from incompatible pointer type | |
kiku.c:2: warning: passing argument 3 of ‘pthread_create’ from incompatible pointer type | |
$ sudo tcpdump | ./kiku | sox -traw -r8k -c1 -eunsigned -b8 - -d |
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 :lispbuilder-sdl) | |
(defun run () | |
(sdl:with-init () | |
(sdl:window 320 240) | |
(draw-xor-texture) | |
(sdl:with-events () | |
(:quit-event () t) | |
(:idle | |
(sdl:update-display))))) |
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 'sinatra' | |
require 'yajl/json_gem' | |
set(:mongrel2_upload) do |value| | |
condition do | |
case value | |
when :start | |
request.env.key?('x-mongrel2-upload-start') | |
when :done | |
request.env.key?('x-mongrel2-upload-done') |
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
ichiban:example$ m2sh version | |
Mongrel2/1.7.5 | |
ichiban:example$ sqlite3 config.sqlite | |
SQLite version 3.6.12 | |
Enter ".help" for instructions | |
Enter SQL statements terminated with a ";" | |
sqlite> select * from setting; | |
1|control_port|ipc://tmp/mongrel2_control | |
2|zeromq.threads|1 | |
3|upload.temp_store|/tmp/mongrel2.upload.XXXXXX |
OlderNewer