Skip to content

Instantly share code, notes, and snippets.

View matsumos's full-sized avatar

Keiichiro Matsumoto matsumos

View GitHub Profile
@JoseRibeiro
JoseRibeiro / Kill mvn jetty:run
Created January 13, 2011 12:57
Kill mvn jetty:run
ps ax | grep jetty | grep -v grep | awk '{system("kill -9 "$1)}'
@nissuk
nissuk / gist:813066
Created February 6, 2011 03:06
CakePHP(1.3)でJSON出力する単純な例
<?php // {app}/config/routes.php
/**
* Routes Configuration
*
* In this file, you set up routes to your controllers and their actions.
* Routes are very important mechanism that allows you to freely connect
* different urls to chosen controllers and their actions (functions).
*
* PHP versions 4 and 5
*
@glassesfactory
glassesfactory / gist:1192936
Created September 4, 2011 14:37
とりあえず OS いれてから nginx + redis + node.js + supervisor 入れるまでの作業ログ
#OS Ubuntu Server 11.04
#ハード構成: Core2Duo 2Core(多分) メモリ:1024MB HDD:30GB
#自宅鯖に kvm で仮想環境作って動かしちょります。
#nginx いれるよ
$ sudo apt-get install build-essential
$ sudo adduser nginx --home=/var/www --shell=/sbin/nologin
$ mkdir src
$ cd src
$ wget wget http://nginx.org/download/nginx-1.0.6.tar.gz
@gardentree
gardentree / gist:1342929
Created November 6, 2011 14:14
ローカルネットワーク上のRails(WEBrick)のレスポンスが遅い時に
#{RUBY_HOME}/lib/ruby/1.9.1/webrick/config.rb の
:DoNotReverseLookup => nil
:DoNotReverseLookup => true
に修正する。
@glassesfactory
glassesfactory / ParallaxObj.coffee
Created November 11, 2011 14:47
Coffee 習作で Parallax なのをつくってみたり。動き方を Tween のイージング関数で指定出来る。 Easing.coffee は別ではります。
class ParallaxObj
id:""
target:null
#イージング関数 jquery.easing とか
easing:null
currentPos:0
#scroll がどの辺まで来たらアニメーションが完了するか
threshold:0
#scroll がどの辺まで来たらアニメーションを開始するか、オフセット値
@glassesfactory
glassesfactory / Easing.coffee
Created November 11, 2011 14:48
イージング関数集。
class Easing
###Liner###
liner:(t,b,c,d)->
return c * t / d + b
###Sine###
SineIn:(t,b,c,d)->
return -c * Math.cos(t / d * (Math.PI / 2 )) + c + b
@mdellavo
mdellavo / formencode-sqlalchemy.py
Created December 3, 2011 16:53
Formencode validators to validate the existence if records in a database
from formencode import validators, Schema
# FIXME - these are the new versions
class RecordExists(FancyValidator):
messages = {'not_found': 'No such record exists'}
def __init__(self, model, field=None, *args, **kwargs):
super(RecordExists, self).__init__(*args, **kwargs)
self.model = model
@zachleat
zachleat / gist:2008932
Created March 9, 2012 21:56
Prevent zoom on focus
// * iOS zooms on form element focus. This script prevents that behavior.
// * <meta name="viewport" content="width=device-width,initial-scale=1">
// If you dynamically add a maximum-scale where no default exists,
// the value persists on the page even after removed from viewport.content.
// So if no maximum-scale is set, adds maximum-scale=10 on blur.
// If maximum-scale is set, reuses that original value.
// * <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=2.0,maximum-scale=1.0">
// second maximum-scale declaration will take precedence.
// * Will respect original maximum-scale, if set.
// * Works with int or float scale values.
@soundkitchen
soundkitchen / create_application.py
Created May 23, 2012 10:08
werkzeug な redis 使った SessionStore とかとか
# vim: fileencoding=utf-8 :
from werkzeug.contrib.sessions import SessionMiddleware
from sessions import RedisSessionStore
def create_application():
app = Application()
app = SessionMiddleware(app, RedisSessionStore())
@santisaez
santisaez / gist:3187798
Created July 27, 2012 12:57
State of the Art: STUN + TURN servers on Linux (July 2012)

STUN implementations

  • stund
  • Content: server daemon and test client for STUN, RFC-3489 only
  • URL does not load, the project seems abandoned
  • The code is also available on SourceForge, last update was on January 2012
  • TCP and TLS modes not supported
  • The server needs two IPs, it’s mandatory and can not be configured
  • C++, no extra libraries required, Windows port available
  • Version = 0.97 (0.96 package available on Debian, 5 years without updates)