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
def main | |
url = ARGV.shift | |
filename = '/tmp/image_on_iterm' | |
system('curl %s > %s 2>/dev/null' % [url, filename]) | |
command =<<CMD % filename | |
osascript -e " | |
tell application \\"iTerm\\" | |
tell the first terminal | |
tell the last session | |
set background image path to \\"%s\\" |
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
Add my Yo username by tapping here: http://justyo.co/YOUPY | |
(if you don't have Yo app get it here http://justyo.co) |
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
package main | |
import ( | |
"errors" | |
"fmt" | |
"math/rand" | |
"time" | |
) | |
func main() { |
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
reuire 'mac-robot' | |
r = Mac::Robot.new | |
loop { | |
# 0xff is not listed in <HIToolbox/Events.h>, so it doesn't affect user's interaction | |
# http://forums.macrumors.com/showpost.php?p=8428116&postcount=2 | |
r.key_press(0xff) |
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
(defun paste-to-osx (text &optional push) | |
(let ((process-connection-type nil)) | |
(let ((proc (start-process "pbcopy" "*Messages*" "pbcopy"))) | |
(process-send-string proc text) | |
(process-send-eof proc)))) | |
(defun copy-from-osx () | |
(let ((buf (get-buffer-create "*pbpaste*"))) | |
(with-current-buffer buf | |
(erase-buffer) | |
(call-process "pbpaste" nil "*pbpaste*") |
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
#!/bin/bash | |
# src: http://taka.no32.tk/diary/20050826.html | |
set -e | |
KEY=`echo $@ | nkf -w -w80 | sed 's/ /+/g'` | |
URI="https://eow.alc.co.jp/search?q=$KEY" | |
CONTENT=`curl -s -e='http://eow.alc.co.jp/' \ | |
-A 'Mozilla/5.0' "$URI" | \ | |
sed -ne '/<ul/,/<\/ul>/p' | grep -v '<li[^>]*><a ' | grep -v '"tango"' | w3m -dump -T 'text/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
window.AudioContext = window.AudioContext||window.webkitAudioContext | |
class Timer | |
constructor: (@useOscillatorNode) -> | |
@url = 'http://dl.dropbox.com/u/334064/silence100ms.wav' | |
@cxt = new AudioContext | |
@gainNode = @cxt.createGain() | |
@gainNode.gain.value = 0.0 | |
@gainNode.connect(@cxt.destination) | |
@oninit = () -> |
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 'shellwords' | |
require 'uri' | |
Earthquake.init do | |
output_filter do |item| | |
text = item["text"] | |
if text |
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
#!/bin/sh | |
# http://hail2u.net/blog/software/easy-to-read-git-log.html | |
git log --graph --pretty='format:%h%d %s %an, %ar' $1 \ | |
| percol \ | |
| sed 's/^[ \|\*]*//' \ | |
| awk '{print $1}' \ | |
| xargs git show |
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
def password(): | |
return getpass.getpass() | |
@parallel | |
def _foo(): | |
sudo('foo') | |
@task | |
def foo(): | |
"""execute foo""" |