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
require 'rubygems' | |
require 'osx/cocoa' | |
require 'osx/hotkey' | |
def open_app(name) | |
`open /Applications/#{name}.app` | |
end | |
hotkeys = 'Command+Control' | |
app_list = { |
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..40).each {|i| if(i%3 == 0 or i.to_s.include?('3')); i="-v Hysterical #{i}" end; system "say #{i}"} |
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 say(text) | |
system "say #{text}" | |
end | |
n = %w(zero ichi knee sun yon go loku shechi hachi koo ju) | |
say 'de-wa-- e-ma-ka-ra-- sun-no-buy-su-tow-- sun-gha-tsuku-- suu-g-no-tohki-da-que-- ahoo-knee-nari-masu' | |
(1..40).each do |i| | |
text = i <= 10 ? n[i] : i < 20 ? "ju #{n[i%10]}" : i%10 == 0 ? "#{n[i/10]} ju" : "#{n[i/10]} ju #{n[i%10]}" | |
text = "-v Hysterical #{text}" if i%3 == 0 or "#{i}".include?('3') |
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
require 'rubygems' | |
require 'sinatra' | |
get '/' do "Hello GAE!! #{Time.now}" end |
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
$ sudo gem install google-appengine -V | |
$ mkdir hello && cd hello | |
$ appcfg.rb gem install sinatra -V | |
$ cat > config.ru <<EOF | |
require 'appengine-rack' | |
require 'hello' | |
AppEngine::Rack.configure_app( | |
:application => 'your-app-id', | |
:version => 1) | |
run Sinatra::Application |
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 -*- | |
from google.appengine.ext import webapp | |
from google.appengine.ext.webapp import util | |
import igo.Tagger | |
class MainHandler(webapp.RequestHandler): | |
def get(self): | |
text = self.request.get('text', u'こんにちは世界') | |
t = igo.Tagger.Tagger('ipadic', True) | |
l = t.parse(text) |
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
# Chromeの最新Dev版にLiveReloadをインストール | |
# Chromeの拡張機能管理画面でLiveReloadの「ファイルの URL へのアクセスを許可する」にチェックを入れておく | |
# ターミナルでguard関係のセットアップ | |
$ gem install rb-fsevent | |
$ gem install em-websocket | |
$ gem install guard | |
$ gem install guard-livereload | |
$ gem install guard-sass |
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
var rounder = { | |
values: { | |
radius: 10 | |
}, | |
components: { | |
radius: { | |
label: 'Corner Radius', | |
type : 'number', | |
units: 'point' | |
}, |