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
@balibali
balibali / mongo_backup.sh
Created January 14, 2011 20:22
mongodump で適当バックアップ用スクリプト
#!/bin/sh
DAYNUMOFWEEK=$(date +%u)
# delete log file of the last week
if [ -f dump$DAYNUMOFWEEK.tar.gz ]
then
rm -v dump$DAYNUMOFWEEK.tar.gz
fi
@balibali
balibali / openpneActionListTask.class.php
Created January 5, 2011 08:48 — forked from co3k/openpneActionListTask.class.php
symfony アプリケーションのアクションの一覧を出すやつ
<?php
/**
* This file is part of the OpenPNE package.
* (c) OpenPNE Project (http://www.openpne.jp/)
*
* For the full copyright and license information, please view the LICENSE
* file and the NOTICE file that were distributed with this source code.
*/
@balibali
balibali / gist:746333
Created December 18, 2010 09:15
DAMtomo TSV Generator
// ==UserScript==
// @name DAMtomo TSV Generator
// @namespace http://rimpei.org
// @description DAM★とものマイページ・プロフィールページで、表示中のDAMコンテンツりれき(ランバトと精密採点DXのみで確認)をページ最下部にTSV形式で表示します。
// @include http://www.clubdam.com/app/damtomo/MyPage.do
// @include http://www.clubdam.com/app/damtomo/member/info/Profile.do?damtomoId=*
// ==/UserScript==
// http://www.otchy.net/20090120/first-five-lines-of-greasemonkey/
var d = document;
@balibali
balibali / umount-mac.sh
Created December 3, 2010 09:32
Macで外部ストレージをumountする際に不要ファイルを削除するスクリプト
#!/bin/sh
if [ ! -d $1 ]; then
echo "error" 1>&2
exit 1
fi
rm -rfv \
"$1/.Spotlight-V100" \
"$1/.Trashes" \
<?php
class hoge
{
public static $fuga = 'tetete';
public function __construct() { self::$fuga = 'tatata'; }
public function hohoho() { return self::$fuga; }
public static function hehehe() { return self::$fuga; }
}
@balibali
balibali / gist:643431
Created October 24, 2010 10:41
diff -u php.ini-production php.ini-development (PHP 5.3.3)
--- php.ini-production 2010-06-24 09:15:12.000000000 +0900
+++ php.ini-development 2010-06-24 09:15:12.000000000 +0900
@@ -511,7 +511,7 @@
; Development Value: E_ALL | E_STRICT
; Production Value: E_ALL & ~E_DEPRECATED
; http://php.net/error-reporting
-error_reporting = E_ALL & ~E_DEPRECATED
+error_reporting = E_ALL | E_STRICT
; This directive controls whether or not and where PHP will output errors,
--- /Users/ogawa/php_configure_5.2.14 2010-10-21 16:22:00.000000000 +0900
+++ /Users/ogawa/php_configure_5.3.3 2010-10-21 15:31:38.000000000 +0900
@@ -45,6 +45,7 @@
--with-libdir=NAME Look for libraries in .../NAME rather than .../lib
--disable-rpath Disable passing additional runtime library
search paths
+ --enable-re2c-cgoto Enable -g flag to re2c to use computed goto gcc extension
SAPI modules:
// ==UserScript==
// @name Utasuki TSV Generator
// @namespace http://rimpei.org/
// @description うたスキのりれきページでスコアを含んだTSVを生成する
// @include http://joysound.com/ex/utasuki/mypage/singhistory/*index.htm
// ==/UserScript==
// Using jQuery
// http://www.otchy.net/20091104/use-jquery-on-greasemonkey/
(function(d,f){var c=function(){if(unsafeWindow.jQuery==null)return 1;f(unsafeWindow.jQuery)};if(c()){var s=d.createElement("script");s.src="//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js";d.getElementsByTagName("head")[0].appendChild(s);(function(){!c()||setTimeout(arguments.callee,100)})()}})(document,function($){main($);$("#b").click(function(){alert("")})});
// ==UserScript==
// @name Utasuki tsv for history
// @namespace http://rimpei.org
// @include http://joysound.com/ex/utasuki/mypage/singhistory/*index.htm
// ==/UserScript==
// 履歴 table.rows を取得(Firebug で XPath コピーしてきた)
var rows = document.evaluate(
"/html/body/div/div[3]/div[2]/div[2]/div/div/div/span/div/table",
document,
<?php
if (is_cli()) {
echo "********************************\n";
echo "* *\n";
echo "* OpenPNE requirements check *\n";
echo "* *\n";
echo "********************************\n\n";
echo sprintf("php.ini used by PHP: %s\n\n", get_ini_path());