基本的には https://github.com/jigish/slate/wiki/JavaScript-Configs を参照
- .slate.jsをホームディレクトリに置く
- .slate => .slate.js の順で読み込まれる
- slate => SlateのAPIにアクセスできる
- _ => underscore.jsを使う
//********************************** | |
// ヘルパー | |
//********************************** | |
var resize = function (width, height, anchor) { | |
if (typeof anchor === 'undefined') anchor = 'top-left'; | |
return slate.operation('resize', { | |
'width' : width, | |
'height' : height, |
基本的には https://github.com/jigish/slate/wiki/JavaScript-Configs を参照
config defaultToCurrentScreen true | |
config nudgePercentOf screenSize | |
config resizePercentOf screenSize | |
# alt-{right,left,up,down} でその方向にウィンドウサイズを変化させる | |
bind right:alt resize +10% +0 | |
bind left:alt resize -10% +0 | |
bind up:alt resize +0 -10% | |
bind down:alt resize +0 +10% |
show-current-dir-as-window-name() { | |
tmux set-window-option window-status-format " #I ${PWD:t} " > /dev/null | |
} | |
show-current-dir-as-window-name | |
add-zsh-hook chpwd show-current-dir-as-window-name |
int incomingByte = 0; | |
int firstLedPinNum = 10; | |
int lastLedPinNum = 13; | |
int ledBlinkFactorSec = 100 | |
void setup() { | |
Serial.begin(9600); | |
for(int i = firstLedPinNum; i <= lastLedPinNum; i++) { | |
pinMode(i, OUTPUT); |
# -*- coding: utf-8 -*- | |
require "gcalapi" | |
require "appscript" | |
include Appscript | |
class ThingsApp | |
def initialize | |
@things = app("Things") | |
end |
require 'pathname' | |
puts File.expand_path(File.join( File.dirname(__FILE__), "../lib/yamada" )) | |
puts Pathname(__FILE__).dirname.expand_path + "../lib/yamada" |
(defvar path-to-dayone "/usr/local/bin/dayone" | |
"Executable path to DayOne CLI") | |
(defun dayone-save-new-entry () | |
"Save buffer as a new DayOne entry" | |
(interactive) | |
(if (executable-find path-to-dayone) | |
(call-process-region | |
1 (point-max) path-to-dayone nil nil nil "new"))) |
(defun move-to-mark () | |
(interactive) | |
(let ((pos (point))) | |
(if (mark) | |
(progn (goto-char | |
(if (boundp 'marked-pos) marked-pos (mark))) | |
(setq marked-pos pos)) | |
(message "There is no marked point to move.")))) | |
(global-set-key (kbd "M-q") 'move-to-mark) |
// total とリスト内の全ての数値に与えられた演算処理を行い、total を逐次更新する | |
// リスト内の要素が全て Number であることが前提 | |
List op_inject := method(op_str, | |
Number inject_op := Number getSlot(op_str) | |
total := 0 | |
call target foreach(v, total = total inject_op(v)) | |
return total) | |
// ネストしているリストにも対応 | |
List sum := method( |