Skip to content

Instantly share code, notes, and snippets.

View balibali's full-sized avatar

Rimpei Ogawa balibali

  • Tejimaya Inc.
  • Tokyo, Japan
View GitHub Profile
<?php
class openpneTruncateTablesTask extends sfBaseTask
{
protected function configure()
{
$this->addOptions(array(
new sfCommandOption('application', null, sfCommandOption::PARAMETER_OPTIONAL, 'The application name', true),
new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'),
new sfCommandOption('no-confirmation', null, sfCommandOption::PARAMETER_NONE, 'Whether to force dropping of the database')
@balibali
balibali / gist:2724046
Created May 18, 2012 08:45
PHP 5.3 で後方互換性がなくて Fatal error になるやつ
<?php
class A {
function A() { echo "bar\n"; }
}
class B extends A {}
class C extends B {}
class D extends C {
function D() {
parent::__construct();
parent::A();
require 'formula'
def build_java?; ARGV.include? "--java"; end
def build_perl?; ARGV.include? "--perl"; end
def build_python?; ARGV.include? "--python"; end
def build_ruby?; ARGV.include? "--ruby"; end
def with_unicode_path?; ARGV.include? '--unicode-path'; end
class UniversalNeon < Requirement
def message; <<-EOS.undent
@balibali
balibali / php.rb
Created March 28, 2011 11:57
HomebrewでPHPビルド(自分用適当バージョン) $ curl -o $(brew --repository)/Library/Formula/php.rb https://raw.github.com/gist/890338/php.rb
require 'formula'
class Php < Formula
url 'http://jp2.php.net/get/php-5.3.10.tar.bz2/from/this/mirror'
md5 '816259e5ca7d0a7e943e56a3bb32b17f'
homepage 'http://www.php.net/'
version '5.3.10'
depends_on 'jpeg'
depends_on 'mcrypt'
"""
WebSocket Client for Growl Notification
Requirements:
- websocket-client:
https://github.com/liris/websocket-client
- Growl:
http://growl.info/documentation/developer/python-support.php
"""
@balibali
balibali / dotemacs-gist-sync.sh
Created March 9, 2011 06:40
Emacs設定ファイル置いてる gist-846942 とローカルのファイルを同期するための適当すぎワロタスクリプト
#!/bin/sh
labeled_diff()
{
if [ $1 ]; then
diff -u --label "local/init.el" ../init.el --label "gist/init.el" init.el
else
diff -u --label "gist/init.el" init.el --label "local/init.el" ../init.el
fi
}
@balibali
balibali / _install.sh
Created March 6, 2011 07:56
Homebrew の Emacs 23.3 用パッチ。typester さんのパッチ (https://github.com/typester/emacs/downloads) をベースにフルスクリーン時にメニューバーを表示するように変更
#!/bin/sh
git --git-dir=$(brew --repository)/.git --work-tree=$(brew --repository) checkout Library/Formula/emacs.rb
brew update
brew uninstall emacs
curl "https://gist.github.com/raw/857132/emacs.rb.patch" | patch -p1 -d $(brew --repository)
brew install emacs --cocoa
ln -sf $(brew --prefix emacs)/Emacs.app /Applications
@balibali
balibali / init.el
Created February 28, 2011 04:39
init.el @balibali
;;; ~/.emacs.d/init.el
;;
;; Emacs 23.3 on Mac OS X 10.6 のことしか考えていません
;;
;;; Emacs ビルド
;;
;; Homebrew で自分用のパッチを当ててビルドする
;; https://gist.github.com/857132
;;
@balibali
balibali / private.xml
Created February 28, 2011 03:18
KeyRemap4MacBook で EISUU to Escape (except Emacs) + EISUU to Option_L (only in Emacs)
<?xml version="1.0"?>
<root>
<item>
<name>Private</name>
<list>
<item>
<name>EISUU to Escape (except Emacs)</name>
<identifier>remap.jis_eisuu2escape_ex_emacs</identifier>
<not>EMACS</not>
<autogen>--KeyToKey-- KeyCode::JIS_EISUU, KeyCode::ESCAPE</autogen>
#!/usr/bin/env python
import httplib
def check(letter):
conn = httplib.HTTPConnection("twitter.com")
conn.request("HEAD", "/naoya_"+letter)
return conn.getresponse().status == 200
if __name__ == '__main__':