Skip to content

Instantly share code, notes, and snippets.

View michiakig's full-sized avatar

aki michiakig

  • Rent the Runway
  • Brooklyn, NY
View GitHub Profile
(defun ext (cmd args)
(with-temp-buffer
(let ((exit (funcall 'call-process cmd nil (current-buffer) nil args)))
(cons exit (buffer-substring (point-min) (point-max))))))
(defun deep-rev (list)
(if (or (null list) (not (listp list))) list
(reverse (mapcar 'deep-rev list))))
(require 'org-publish)
(setq org-publish-project-alist
'(("org-notes"
:base-directory "~/scratch/org/"
:base-extension "org"
:publishing-directory "~/scratch/public_html/"
:recursive t
:publishing-function org-publish-org-to-html
:headline-levels 4 ; Just the default for this project.
:auto-preamble t
- printTree t;
a
/ \
b c
/ \ / \
d e x y
/ \
q w
val it = () : unit
- val tree = Node("a",Node("b",Leaf,Leaf),Node("c",Leaf,Leaf));
val tree = Node ("a",Node ("b",Leaf,Leaf),Node ("c",Leaf,Leaf)) : string tree
- printTree tree;
a
/ \
b c
val it = () : unit
- val tree' = Node("x",Node("y",Leaf,Leaf),Node("z",Node("q",Leaf,Leaf),Node("w",Leaf,Leaf)));
(*
CM.make "$/regexp-lib.cm";
*)
val getc: string -> (char, int) StringCvt.reader =
fn s => fn i =>
if (i < String.size s)
then SOME(String.sub(s, i), i+1)
else NONE
(add-hook 'sml-mode-hook (lambda () (defun sml-smie-rules (kind token) 7))))))
datatype Sexp = Satom of string | Scons of Sexp * Sexp | Snil
(* returns a string representation of an Sexp *)
fun showSexp s =
let
(* if fresh, Sexp is the head of a new list, not an inner cons cell *)
fun showSexp' Snil _ = "nil"
| showSexp' (Satom a) fresh =
if not fresh
then ". " ^ a (* dotted tail notation *)
structure Set : ORD_SET = IntListSet
structure Map : ORD_MAP = ListMapFn(
struct
type ord_key = Set.set
val compare = Set.compare
end)
val m = Map.insert(Map.empty, Set.singleton 1, 2)
@michiakig
michiakig / init.el
Last active October 13, 2015 23:38
;; package.el stuff
(require 'package)
(add-to-list 'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/") t)
(package-initialize)
(when (not package-archive-contents)
(package-refresh-contents))
(defvar my-packages '(color-theme-solarized magit smex sml-mode))
(dolist (p my-packages)
(when (not (package-installed-p p))