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
<?xml version="1.0"?>
<root>
<item>
<name>Change Command-P to Up arrow</name>
<identifier>private.command_p_to_up_arrow</identifier>
<autogen>
__KeyToKey__
KeyCode::P, ModifierFlag::COMMAND_L,
KeyCode::CURSOR_UP
</autogen>
package com.example.helloworld.core;
public enum Color {
BLUE,
GREEN
}
@michiakig
michiakig / gist:9880618
Last active August 29, 2015 13:57 — forked from cab222/gist:9878465
import java.util.*;
public class TypeSafety {
public static void main(String[] args){
List<Set<?>> listOfWildcardSet = new ArrayList<Set<?>>();
listOfWildcardSet.add(new HashSet<String>());
listOfWildcardSet.add(new HashSet<Integer>());
listOfWildcardSet.set(0, listOfWildcardSet.get(0));
listOfWildcardSet.set(1, listOfWildcardSet.get(1));
signature POSITIONAL_STREAM =
sig
type elem
type stream
val peek : stream -> (elem * stream) option
val getPos : stream -> pos
end
structure SubstringStream : STREAM =
import java.util.List;
import java.util.ArrayList;
/*
* Lexical analyzer for Scheme-like minilanguage:
* (define (foo x) (bar (baz x)))
*/
public class Lexer {
public static enum Type {
// This Scheme-like language has three token types:
type 'a monoid = {zero : 'a; plus : 'a -> 'a -> 'a}
let sum (m : 'a monoid) (l : 'a list) : 'a = List.fold_left m.plus m.zero l
let string_summer = sum {zero = ""; plus = (^)}
let int_summer = sum {zero = 0; plus = (+)}
#lang eopl
;(module lang (lib "eopl.ss" "eopl")
(require "drscheme-init.scm")
(provide (all-defined))
;;;;;;;;;;;;;;;; grammatical specification ;;;;;;;;;;;;;;;;
(define the-lexical-spec
utahraptor:~ aki$ rlwrap ocaml
Objective Caml version 3.12.1
# #use "topfind";;
- : unit = ()
Findlib has been successfully loaded. Additional directives:
#require "package";; to load a package
#list;; to list the available packages
#camlp4o;; to load camlp4 (standard syntax)
#camlp4r;; to load camlp4 (revised syntax)
#!/usr/bin/emacs --script
(princ (format "batch mode: %s\n" noninteractive))
(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))))))