Skip to content

Instantly share code, notes, and snippets.

View tomohiro's full-sized avatar
😎

Tomohiro Taira tomohiro

😎
View GitHub Profile
@katsuma
katsuma / taifu
Created December 23, 2011 18:56
taifu will add youtube sound to your iTunes library silently
#!/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'
@sjl
sjl / Menlo-ForPowerline.ttc.zip
Created January 17, 2012 18:09
Patched Menlo for Powerline. This one includes the bold, italic, etc variants.
class PostsController < ActionController::Base
def create
Post.create(post_params)
end
def update
Post.find(params[:id]).update_attributes!(post_params)
end
private
@DAddYE
DAddYE / hack.sh
Created March 19, 2012 11:31
OSX For Hackers
#!/bin/sh
##
# This is a script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# Run in interactive mode with:
# $ sh -c "$(curl -sL https://raw.github.com/gist/2108403/hack.sh)"
#
# or run it without prompt questions:
class ActionDispatch::Routing::Mapper
def draw(routes_name)
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb")))
end
end
BCX::Application.routes.draw do
draw :api
draw :account
draw :session
@jugyo
jugyo / config.ru
Created June 12, 2012 01:48
easy way to share files on heroku with basic auth
use Rack::Auth::Basic do |username, password|
username == 'username' && password == 'password'
end
run Rack::Directory.new "./foo"
@rtyler
rtyler / gist:3041462
Created July 3, 2012 18:09
Rakefile for puppet-lint in CI
LINT_IGNORES = ['rvm']
namespace :lint do
desc "Check puppet module code style."
task :ci do
begin
require 'puppet-lint'
rescue LoadError
fail 'Cannot load puppet-lint, did you install it?'
end
@Epictetus
Epictetus / gist:3386858
Created August 18, 2012 13:28 — forked from nakunaru/gist:3367129
PostgreSQLのデータファイル名を確認する方法
PostgreSQLでテーブルのデータファイル名を確認する方法。
PostgreSQLでは、1テーブル/1インデックス毎に1ファイルが割り当てられる。
ディスク容量にあまり余裕がない場合などに、大きなファイルを持つテーブルを、
別ディスクに移動させたければ、
ALTER TABLE 表名 SET TABLESPACE テーブルスペース名;
などとして別領域へ移動させたい場合がある。
しかし、ファイル名には一意な数値が使用されているため、どのファイルがどのテーブルの
ものなのかパッと見では判別できない。
@keijiro
keijiro / youtube on safari without flash.md
Created September 3, 2012 10:11
Flash Player 無しに Safari で YouTube を観る方法

Flash Player 無しに Safari で YouTube を観る方法

YouTube における動画の再生には一般に Flash Player が使用されていますが、HTML5 プレイヤーのトライアルにオプトインすることにより、Flash Player が無くてもコンテンツの再生が可能になります。ただし、一部のコンテンツ(広告入りの動画?)においては、この機能は無効化されており、Flash Player のインストールを強制されます。

ちょっと迂遠で分かり難いですが、YouTube の HTML5 プレイヤーを封印してから ClickToPlugin 拡張をインストールすれば、これを回避できます。

Disable YouTube HTML5 拡張をインストールする

以下の URL (直リンク)からインストールします。