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
#load "labltk.cma";; | |
(* You must call Tk.openTk somewhere before tcl_eval *) | |
let top = Tk.openTk () | |
let rec tcl_eval_str str = | |
tcl_eval_list (Protocol.splitlist str) | |
and tcl_eval_list lst = | |
Protocol.tkEval (list2tkArgs lst) | |
and list2tkArgs lst = |
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
#directory "+labltk";; | |
#load "labltk.cma";; | |
let top = Tk.openTk () | |
let rec tcl_eval_str str = | |
tcl_eval_list (Protocol.splitlist str) | |
and tcl_eval_list lst = | |
Protocol.tkEval (list2tkArgs lst) | |
and list2tkArgs lst = |
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
module CharClass = | |
struct | |
let is_space c = c = ' ' || c = '\t' | |
let strrange str s e = | |
String.sub str s (e-s) | |
let strseek str start fn = | |
let pos = ref start | |
and end_ = String.length str in |
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
% -*- mode: prolog; coding: utf-8 -*- | |
% Simple util to make truth table. | |
% tested under gnu prolog and swi prolog. | |
% ?- consult('truthtable1.pl'). | |
% | ?- tt([[y,n], [y,n]], writeln). | |
% [y,y] | |
% [n,y] |
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
# nginx_public_apps.conf | |
# http://example.com/-$USER-$APP_NAME/ | |
# => /home/$USER/public_apps/apps/$APP_NAME/app/var/tmp/fcgi.sock | |
# Serve static files directly, with gzip_static. | |
location ~ ^/-(?<user>\w+?)-(?<app_name>[^/]+)/(?<static_fn>.*?\.(html|css|js|gif|jpg|png|ico|mp4|webm))$ { | |
set $app_root /home/$user/public_apps/apps/$app_name/app; | |
root $app_root/html; | |
try_files /$static_fn =404; |
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
let (//) optional default = | |
match optional with | |
| None -> default | |
| Some x -> x | |
(* You can use this like: | |
(Map.find t s // 0) + 1 | |
*) |
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
(* open Core.Std | |
When I opened Core.Std here, no problem occured. But... | |
*) | |
module type ID = sig | |
type t | |
val of_string : string -> t | |
val to_string : t -> string | |
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
# file(1) magic for Redis database file. See https://github.com/sripathikrishnan/redis-rdb-tools/wiki/Redis-RDB-Dump-File-Format | |
0 string REDIS Redis database file, | |
>5 regex [0-9][0-9][0-9][0-9] version %s, | |
>9 string \xfe db number | |
>>10 byte x %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
#!/bin/zsh | |
option_defs+=( | |
n=o_dryrun | |
s=o_silent | |
) | |
function DO { | |
if (($#o_dryrun || ! $#o_silent)); then | |
print -- $argv | |
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
#!/usr/bin/env perl | |
use strict; | |
use warnings FATAL => qw/all/; | |
#======================================== | |
use fields qw/o_table | |
o_create | |
o_transaction | |
columns |
OlderNewer