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
@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));
package com.example.helloworld.core;
public enum Color {
BLUE,
GREEN
}
<?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>
@michiakig
michiakig / init.el
Created July 19, 2011 15:00
custom user file for emacs-starter-kit
(require 'package)
(add-to-list 'package-archives
'("marmalade" . "http://marmalade-repo.org/packages/") t)
(package-initialize)
;; use Mac command key for meta
(setq mac-command-modifier 'meta)
;; recursively add emacs dir to load-path
(let ((default-directory "~/.emacs.d/"))
(normal-top-level-add-subdirs-to-load-path))
@michiakig
michiakig / init.el
Created July 20, 2011 17:27
minimal dotemacs for slime
;; SLIME
(add-to-list 'load-path "~/.emacs.d/slime")
(load "slime.el")
(eval-after-load "slime"
'(progn (slime-setup '(slime-repl))))
(eval-after-load 'slime '(setq slime-protocol-version 'ignore))
(require 'slime)
(slime-setup '(slime-scratch slime-editing-commands))
(setq inferior-lisp-program "sbcl") ; replace with your Common Lisp implementation
@michiakig
michiakig / three.html
Created August 19, 2011 20:55
three.js demo in ClojureScript
<html>
<head></head>
<body>
<script type="text/javascript" src="Three.js"></script>
<script type="text/javascript" src="RequestAnimationFrame.js"></script>
<script type="text/javascript" src="output.js"></script>
</body>
</html>
@michiakig
michiakig / Foo.java
Created August 24, 2011 04:19
Java closures
public class Foo {
final int bar = 6;
final int[] flarp = new int[] {6};
public class Baz {
int bla() {
return bar;
}
int bloo() {
require 'RMagick'
import Magick
if(ARGV.length < 2)
puts "call with image filename and gcode filename"
exit(1)
end
XSTEP = 5
YSTEP = 5
;; set two global variables
(setq x 'global-x)
(setq y 'global-y)
;; define a function that returns a nested function
(defun return-a-nested-fn (x)
;; the nested function takes no arguments and returns a list of two values
(lambda () (list x y)))
;; call that function, and call the function returned
@michiakig
michiakig / threadpolicy.xml
Created November 19, 2012 20:26
CheckThread blog post threadpolicy.xml
<?xml version="1.0"?>
<threadpolicy version="1.0">
<class name="android.app.Activity">
<policy type="ThreadConfined" threadname="ThreadName.MAIN">
<method pattern="on.*" />
</policy>
</class>
<class pattern="android.*View">
<policy type="ThreadConfined" threadname="ThreadName.MAIN">
<method pattern=".*" />