This file contains 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
;; 怒りのタイポ修正 | |
;; 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 |
This file contains 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
#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) ({ \ |
This file contains 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
if ( ! Detector.webgl ) Detector.addGetWebGLMessage(); | |
var container, stats; | |
var camera, scene, renderer; | |
var mesh; | |
init(); | |
animate(); |
This file contains 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
(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") |
This file contains 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
((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 |
This file contains 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
(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';")) |
This file contains 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
user=> (clojure-version) | |
"1.4.0" | |
user=> (require '[clojure.math.numeric-tower :as math]) | |
nil | |
user=> (for [n (range 0 26)] | |
#_=> (let [v (vec (range 0 (math/expt 2 n)))] | |
#_=> (do (System/gc) | |
#_=> (time (reduce + (filter even? (map #(mod % 2) v))))))) | |
("Elapsed time: 0.272565 msecs" |
This file contains 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
;;; tabbar+.el --- Tabbar extensions | |
;; Copyright (C) 2012 | |
;; Author: | |
;; Keywords: | |
;; Version 0.2.2 | |
;;; Commentary: |
This file contains 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 sort-lines-random (beg end) | |
"Sort lines in region randomly." | |
(interactive "r") | |
(save-excursion | |
(save-restriction | |
(narrow-to-region beg end) | |
(goto-char (point-min)) | |
(let ;; To make `end-of-line' and etc. to ignore fields. | |
((inhibit-field-text-motion t)) |
This file contains 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 'linum) | |
(require 'whitespace) | |
(defface linum-hidden-face '((t :inherit (shadow default))) nil) | |
(set-face-attribute | |
'linum-hidden-face nil | |
:foreground (assoc-default 'background-color default-frame-alist)) | |
(defun ytl-hide-spaces (str) |
NewerOlder