This file contains hidden or 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
(defun base64 (&optional b e) | |
"base64 encode/decode" | |
(interactive "r") | |
(shell-command-on-region b e "ruby -rbase64 -e 's = $stdin.gets; print Base64.send(/^[A-Za-z0-9\\+\\/=]+$/ =~ s ? :decode64 : :encode64, s).split($/).join'" nil t)) |
This file contains hidden or 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 'thor' | |
class SSHEnv < Thor | |
SSH_DIR = "~/.ssh" | |
desc 'use PRESET', 'Switch SSH config preset to PRESET' | |
method_option :dry, :type => :boolean, :aliases => '-d' | |
def use(name="default") |
This file contains hidden or 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 |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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")); | |
} | |
} |