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 Keynote = Application("Keynote"); | |
var theme = Keynote.themes.whose({name: "cookpad"}).first | |
var doc = Keynote.Document({documentTheme: theme}); | |
Keynote.documents.push(doc); // Create a new document with specified theme |
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
pe() { peco | while read LINE; do $@ $LINE; print -s "$@ $LINE"; done } | |
alias o='git ls-files | pe open' | |
alias e='ghq list -p | pe cd' | |
zshaddhistory() { | |
local line=${1%%$'\n'} | |
local cmd=${line%% *} | |
[[ ${cmd} != (l|l[sal]) | |
&& ${cmd} != (m|man) |
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
location /blog/ { | |
if ($args = "p=845") { | |
set $args ''; | |
rewrite ^ /blog/2014/02/23/%E3%81%93%E3%82%8C%E3%81%AF%E3%82%84%E3%81%B0%E3%81%84/ permanent; | |
} | |
} |
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 prefix | |
set-option -g prefix C-t | |
bind-key C-t send-prefix | |
unbind-key C-b | |
# split window | |
bind-key s split-window -h | |
bind-key v split-window | |
# copy mode by vi bind |
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
irb(main):009:0> tracks = Track.find_by(name: "ばらの花") | |
=> #[<Itunes::Track:0x007fda6b251398 @persistent_id="7614C19B856C4AB9", @name="ばらの花", @album="TEAM ROCK", @artist="くるり", @track_count="0", @track_number="9">] | |
irb(main):010:0> track = tracks.first | |
irb(main):011:0> track.artist | |
=> "くるり" | |
irb(main):012:0> track.play # 再生開始 | |
=> #<Itunes::Track:0x007fda6b2713a0 @persistent_id="4B55CDCFEAE6E492", @name="ばらの花", @album="ベスト オブ くるり Tower Of Music Lover", @artist="くるり", @track_count="13", @track_number="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
var max = 10000 | |
var pi = Math.PI; | |
var a = new Array(max); | |
console.time('native'); | |
for (var i = 0, len = a.length; i < len; i++) { | |
a[i] = pi; | |
}; | |
console.timeEnd('native'); |
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
file = MacTypes::FileURL.path(File.expand_path('/tmp/speech.aiff')) | |
command = "tell app \"iTunes\" to add \"#{file.hfs_path}\"" | |
exec_command = "osascript -e '#{command}'" | |
`#{exec_command}` |
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
# -*- coding: utf-8 -*- | |
require 'rubygems' | |
require 'socket' | |
require 'open-uri' | |
require 'nokogiri' | |
require 'growl' | |
require 'ruby-debug' | |
module PopZap | |
LIVE_URL = 'http://tv2ch.nukos.net/tvres.html' |
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
#!/home/katsumatv/.rvm/rubies/ruby-1.9.3-p125/bin/ruby | |
ENV['GEM_HOME'] = '/home/katsumatv/.rvm/gems/ruby-1.9.3-p125' | |
ENV['PATH'] = "#{ENV['PATH']}:/home/katsumatv/.rvm/gems/ruby-1.9.3-p125/bin:/home/katsumatv/bin" | |
require 'rubygems' | |
require 'sinatra' | |
require 'json' | |
get '/' do | |
status 403 |
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
#!/usr/bin/env ruby | |
# usage: | |
# taifu http://www.youtube.com/watch?v=KPWfBfFFrwsx | |
# taifu depends on VLC.app and rb-appscript gem | |
require 'rubygems' | |
require 'appscript' | |
require 'fileutils' |
NewerOlder