Skip to content

Instantly share code, notes, and snippets.

@Johniel
Johniel / core.clj
Created June 10, 2013 23:08
taplの3章?
(ns tapl.core
(:require [instaparse.core :as insta]))
(def my-parser
(insta/parser
"<T> := 'true' | 'false' | '0' |
'succ'<space>T | 'pred'<space>T | 'iszero'<space>T |
'if'<space>T<space>'then'<space>T<space>'else'<space>T;
space := #'\\s';"))
@Johniel
Johniel / ガ出力
Last active December 19, 2015 10:59
インデントを足した
((class ClassName
(f :: int -> char -> float -> string)
(g :: void -> double))
(struct StructName : []
(n:int)
(s:string))
(struct Klass : [ClassName, ]
(m:int)
(t:string))
(add :: int(a) -> int(b) -> int
@Johniel
Johniel / appearance.el
Created July 27, 2013 23:04
以前のfaceの設定
(when window-system
(eval-safe
;; (add-to-list 'default-frame-alist '(alpha . (95 80)))
(add-to-list 'default-frame-alist '(foreground-color . "ivory"))
(add-to-list 'default-frame-alist '(background-color . "#2D0922"))
(add-to-list 'default-frame-alist '(cursor-color . "purple2"))
(set-face-background 'region "RoyalBlue4")
(set-face-background 'cua-rectangle "DodgerBlue4")
(set-face-foreground 'mode-line "white")
(set-face-background 'mode-line "#2d2d30")
if ( ! Detector.webgl ) Detector.addGetWebGLMessage();
var container, stats;
var camera, scene, renderer;
var mesh;
init();
animate();
@Johniel
Johniel / list.cpp
Last active August 29, 2015 13:56
container_of怖い
#include <iostream>
#include <vector>
using namespace std;
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
#define list_entry(ptr, type, member) container_of(ptr, type, member)
#define container_of(ptr, type, member) ({ \
@Johniel
Johniel / typo-fix.el
Created July 22, 2014 03:02
タイポしすぎぃ!
;; 怒りのタイポ修正
;; http://d.hatena.ne.jp/kitokitoki/20091124/p2
(defun delete-word (arg)
"Delete characters forward until encountering the end of a word.
With argument ARG, do this that many times."
(interactive "p")
(delete-region (point) (progn (forward-word arg) (point))))
;; http://d.hatena.ne.jp/kitokitoki/20091124/p2