- 名前
- OYAMADA, Masafumi
- アカウントなど
- http://twitter.com/stillpedant
This file contains hidden or 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://en.wikipedia.org/wiki/Data_structure_alignment#Typical_alignment_of_C_structs_on_x86 */ | |
function createStructWithPaddings(name, members, alignmentLimit) { | |
var membersWithPaddings = []; | |
var currentOffset = 0; | |
var maximumAlignment = 0; | |
if (typeof alignmentLimit === "undefined") | |
alignmentLimit = Infinity; | |
var insertedCount = 0; |
This file contains hidden or 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
;;; lemon-mode.el --- Major mode for editing lemon grammar files | |
;; Copyright (C) 2012 mooz | |
;; Author: mooz <[email protected]> | |
;; Keywords: lemon | |
;; This program is free software; you can redistribute it and/or modify | |
;; it under the terms of the GNU General Public License as published by | |
;; the Free Software Foundation, either version 3 of the License, or |
This file contains hidden or 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
#compdef waf | |
local context state line | |
typeset -A opt_args | |
local -a \ | |
arguments_default \ | |
arguments_configure \ | |
arguments_build_install \ | |
arguments_step \ |
This file contains hidden or 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
var EXPORTED_SYMBOLS = ["Logger"]; | |
var { classes: Cc, interfaces: Ci } = Components; | |
function Logger(logFileName) { | |
this.logFile = this.openFile(logFileName); | |
} | |
Logger.prototype = { | |
encoding: "UTF-8", |
This file contains hidden or 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
(global-set-key (kbd "C-x C-r") 'anything-directory-tree) | |
(defun anything-directory-tree () | |
(interactive) | |
(anything 'anything-c-source-directory-tree)) | |
(defvar anything-c-source-directory-tree | |
'((name . "Directory Tree") | |
(init . (lambda () | |
(shell-command "tree -L 2 -f" |
This file contains hidden or 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
;; ============================================================ ;; | |
;; Flymake Highlight Mode Line {{{ | |
;; ============================================================ ;; | |
(defvar flypaint:error-face | |
'(:foreground "white" :background "red")) | |
(defvar flypaint:warning-face | |
'(:foreground "white" :background "orange red")) |
This file contains hidden or 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
4 つの API メソッドを共有する 2 つの配列( 1 つはキー用、もう 1 つはバリュー用)を => 2 つの配列( 1 つはキー用、もう 1 つはバリュー用)を | |
# 共有「する」のではなく 4 つの API により共有「される」のだと思い | |
# ます.それぞれの API は内部で 2 つの配列にアクセスするよ,という | |
# ことですね. | |
従って、それらのキーは => キーとなったオブジェクトは | |
マニュアルでマップを記述した場合 => (2 つの配列を使って)マップを | |
自作する場合, |
This file contains hidden or 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
// "Foo".red.log(); | |
Object.defineProperty(String.prototype, "log", { | |
value: function () { | |
dump(this + "\n"); | |
} | |
}); | |
let (colerCodePairs = { | |
black : 30, |
This file contains hidden or 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
// Insert codes below into PRESERVE area of your .keysnail.js file. | |
(function () { | |
var local = {}; | |
plugins.options["site_locak_keymap.local_keymap"] = local; | |
function fake(k, i, type) function () { key.feed(k, i, type); }; | |
function pass(k, i, type) [k, fake(k, i, type)]; | |
function ignore(k) [k, null]; |