Skip to content

Instantly share code, notes, and snippets.

@rosylilly
rosylilly / gist:3401612
Created August 20, 2012 06:40
先輩と覚える HTTP ステータスコード

先輩に学ぶ HTTP Status Code

超雑にまとめました。修正してください。

登場人物

  • アプリケーション先輩: いつも忙しい。横に広がるのが得意(デブじゃない)。
  • 後輩: 頼んでばっかしで役に立たない。
  • サーバー先輩: アプリケーション先輩と仲がいい。Unix Socket でつながるくらい仲良し。
  • プロクシ先輩: アプリケーション先輩とかサーバー先輩と後輩の間を取り持って代わりに伝えたりしてくれる。たまに勝手にレスポンスを書き換える。
@sotarok
sotarok / growl_restart
Created December 6, 2011 07:23
Mac OS X で Growl が暴走したときに再起動 ref: http://qiita.com/items/1302
#!/bin/bash
PID=$(ps ax | grep Growl.app | grep -v grep | awk '{print $1};')
test -z "$PID" && open -j -a Growl && echo "Growl restarted on $(date) :: pid not found ($PID)" >> /tmp/growl_restart.log && exit
CPU_USAGE=$(top -pid $PID -l 2 -s 5 -stats cpu | tail -n1 | cut -d"." -f1)
if test $CPU_USAGE -gt 80
then
killall Growl
open -j -a Growl
@juriansluiman
juriansluiman / IndexController.php
Created October 14, 2011 08:31
IndexController with "preDispatch" event simulation
<?php
namespace Application\Controller;
use Zend\Mvc\Controller\ActionController
Zend\Mvc\MvcEvent;
class IndexController extends ActionController
{
public function indexAction()
@sasezaki
sasezaki / gist:879328
Created March 21, 2011 11:32
より良いPHPerになるための20Tips(ハイエンドオタク編)