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
beep_if_long_time_past() { | |
LAST_COMMAND_DURATION=$(($(date +%s) - ${LAST_COMMAND_TIME})) | |
LAST_COMMAND=${BASH_COMMAND} | |
[[ ${LAST_COMMAND_DURATION} -gt 10 ]] && { growlnotify -a Terminal -t "job finished" -m "${LAST_COMMAND_DURATION} seconds for ${LAST_COMMAND}!"; } | |
export LAST_COMMAND_TIME= | |
} | |
export PROMPT_COMMAND=beep_if_long_time_past | |
trap '[ -z ${LAST_COMMAND_TIME} ] && export LAST_COMMAND_TIME=$(date +%s)' DEBUG |
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
# とりあえず今のリスト | |
macair:test tmaeda$ milk list | |
bundle-milkode-1.0.0 | |
nested_scaffold-0.2.1 | |
*milkode* : 2 packages, 79 records in /Users/tmaeda/.milkode/db/milkode.db. | |
# rails を一旦uninstallしてみる | |
macair:test tmaeda$ gem uninstall rails | |
You have requested to uninstall the gem: |
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
1.9.3p194> 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 | |
=> 0.9999999999999999 |
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
$ ospec failures.ml | |
Failures | |
infix failure (FAILED: 1) | |
infix neg failure (FAILED: 2) | |
ident failure (FAILED: 3) | |
ident neg failure (FAILED: 4) | |
one arg ident failure (FAILED: 5) | |
one arg ident neg failure (FAILED: 6) | |
fun failure (FAILED: 7) | |
fun neg failure (FAILED: 8) |
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
def foo(ary) | |
rec = Proc.new do |ary| | |
if ary == [] | |
next 0 | |
else | |
rtn = ary[0] + rec.call(ary[1..-1]) | |
next rtn | |
end | |
end | |
rec.call(ary) |
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
# sprk2012 pull req graph | |
require 'date' | |
require 'time' | |
require 'octokit' | |
client = Octokit::Client.new({:auto_traversal => true}) | |
pulls = client.pulls("sprk2012/sprk2012-cfp") | |
days = (Date.new(2012,4,26)..Date.new(2012,5,25)).to_a.map{|d| [d.to_s, 0]} |
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
# -*- coding: utf-8 -*- | |
# simplenote xml を momonote csv に変換 | |
require 'nokogiri' | |
require 'csv' | |
require 'time' | |
CSV.open("momonote.csv", "wb", {:col_sep => "\t", :row_sep => "\r\n"}) do |csv| | |
doc = Nokogiri::XML(File.read("simplenote_export_1.xml")) | |
doc.xpath("//note").each do |node| |
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
precompiled/x86-darwin/274.s:428:suffix or operands invalid for `pop' | |
precompiled/x86-darwin/274.s:458:suffix or operands invalid for `pop' | |
precompiled/x86-darwin/274.s:459:suffix or operands invalid for `jmp' | |
precompiled/x86-darwin/274.s:464:suffix or operands invalid for `push' | |
precompiled/x86-darwin/274.s:494:suffix or operands invalid for `pop' | |
precompiled/x86-darwin/274.s:501:suffix or operands invalid for `push' | |
precompiled/x86-darwin/274.s:548:suffix or operands invalid for `pop' | |
precompiled/x86-darwin/274.s:554:suffix or operands invalid for `push' | |
precompiled/x86-darwin/274.s:569:suffix or operands invalid for `pop' | |
precompiled/x86-darwin/274.s:570:suffix or operands invalid for `jmp' |
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
;;; .emacs.mac.el --- | |
;; Command-Key and Option-Key | |
(setq ns-command-modifier (quote meta)) | |
(setq ns-alternate-modifier (quote super)) | |
(when (and (eq window-system 'ns) (= emacs-major-version 23)) | |
(set-fontset-font | |
(frame-parameter nil 'font) | |
'japanese-jisx0208 |
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
def foo() | |
puts "foo" | |
yield | |
end | |
a = 1 | |
>> foo{ puts a; a += 1;} | |
foo | |
1 |