Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env macruby
# encoding: utf-8
require 'ubygems'
require 'digest/md5'
framework 'cocoa'
framework 'ScriptingBridge'
# http://www.johnmyleswhite.com/notebook/2009/11/20/cleaning-up-an-itunes-library-with-macruby/comment-page-1/#comment-17798
#!/bin/sh
bundle gem $1
cd $1
rspec --init
import android
droid = android.Android()
while True:
word = droid.recognizeSpeech().result
droid.ttsSpeak(word)
print word
@youpy
youpy / alc.py
Created April 6, 2012 06:01
speech + search alc
import android
droid = android.Android()
droid.view('http://eow.alc.co.jp/sp/search.html?q=' + droid.recognizeSpeech().result)
@youpy
youpy / gist:2258106
Created March 31, 2012 00:17
installing perl on local
curl -L http://cpanmin.us | perl - -l ~/local/perl5 App::cpanminus local::lib
echo 'eval `perl -I ~/local/perl5/lib/perl5 -Mlocal::lib=~/local/perl5`' >> ~/.zshrc
require 'ubygems'
require 'itunes_observer'
require 'eventmachine'
class EventMachine::ITunesWatch
def initialize
@observer= ITunesObserver.new
@observer.on_pause do |result|
paused(result)
end
@youpy
youpy / hee.rb
Created February 24, 2012 05:35
#!/usr/bin/env ruby
# encoding: utf-8
# usage:
# $ command arg1 arg2 arg3 | hee
require 'pathname'
$kcode = 'u'
$stdout.sync = true
# # .zshrc
#!/usr/bin/env ruby
%w|ubygems pathname pit erb|.each {|g| require g }
def read_sections
sections = {}
section = nil
DATA.readlines.each do |line|
if line =~ /^@@\s+(.+)/
section = $1
elsif section
#!/usr/bin/env ruby
# usage
# $ $(export_heroku_config.rb | grep OAUTH)
config = `heroku config`
config.split(/[\r\n]/).each do |line|
key, value = line.chomp.split(/\s+=>\s+/)
puts "export #{key}=#{value}"
end
// ==UserScript==
// @name internet
// @namespace http://d.hatena.ne.jp/youpy/
// @include http://www.ntticc.or.jp/Exhibition/2012/Internet_Art_Future/index_j.html
// @version 0.3
// @updateURL https://raw.github.com/gist/1727155/internet.user.js
// ==/UserScript==
var serverUrl = 'http://c3581516868fb3b71746931cac66390e.no.de/';
var script = document.createElement('script');