Skip to content

Instantly share code, notes, and snippets.

View kawaz's full-sized avatar
🏠
Working from home

Yoshiaki Kawazu kawaz

🏠
Working from home
View GitHub Profile
@Takazudo
Takazudo / androidViewport.js
Created January 10, 2011 08:09
some androids can't handle meta viewport width=number.
/*
There's <meta name="viewport" content="width=480" /> in html then...
*/
// handle Android's viewport
(function($, undefined){
$.browser.android = /android/i.test(navigator.userAgent);
if(!$.browser.android){
@kawaz
kawaz / GoogleSBM_kawaz.user.js
Created March 4, 2011 16:08
Google+SBM( http://userscripts.org/scripts/show/23906 )がニュースに対応してなかったのでXPathを修正したバージョン。
// ==UserScript==
// @name Google+SBM
// @namespace http://wildlifesanctuary.blog38.fc2.com/
// @description Show SBM count in Google search result
// @include http://*.google.*/*q=*
// ==/UserScript==
// this script based on
// http://d.hatena.ne.jp/kusigahama/20051207#p1
// http://la.ma.la/blog/diary_200607281316.htm
@jed
jed / ATNDNT.js
Created April 2, 2011 10:41
a script that lets you know when your friends sign up for new ATND.org events
var http = require( "http" )
, url = require( "url" )
, exec = require( "child_process" ).exec
, username = process.argv[ 2 ]
, seconds = +process.argv[ 3 ] || 300
, friends
, events = {}
if ( !username ) {
@koichik
koichik / gist:921465
Created April 15, 2011 09:35
getLineNumber
// http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi
function customPrepareStackTrace(error, structuredStackTrace) {
return structuredStackTrace[0].getLineNumber();
};
function getLineNumber() {
var original = Error.prepareStackTrace;
Error.prepareStackTrace = customPrepareStackTrace;
var error = {};
Error.captureStackTrace(error, getLineNumber);
@Jxck
Jxck / .gitignore
Created September 24, 2011 07:01
show repository status of modules listed on https://github.com/joyent/node/wiki/modules
.DS_Store
@utaani
utaani / seteth1.sh
Created March 22, 2012 23:14
ifconfig eth1 with fixed IP address on Amazon-VPC ENI(Elastic Network Interface)
#!/bin/sh
# set IP address with Amazon-VPC ENI(Elastic Network Interface) address and other.
# get eth0/1 MAC addresses
MACADDR0=`cat /sys/class/net/eth0/address`
MACADDR1=`cat /sys/class/net/eth1/address`
# get eth0/1 IP addresses on ENI
IPADDR0=`/usr/bin/curl -s http://169.254.169.254/latest/meta-data/network/interfaces/macs/${MACADDR0}/local-ipv4s/`;
IPADDR1=`/usr/bin/curl -s http://169.254.169.254/latest/meta-data/network/interfaces/macs/${MACADDR1}/local-ipv4s/`;
# ifconfig on eth1 (ENI)
/sbin/ifconfig eth1 inet ${IPADDR1} netmask 255.255.255.0 2>&1 >> /tmp/seteth1.log
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 23, 2024 15:29
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@fxsjy
fxsjy / gist:3291755
Last active January 9, 2021 16:12
Memcached in JavaScript based on Node.JS
//author: Sun, Junyi (weibo.com/treapdb)
//usage: node --nouse-idle-notification --expose-gc --max-old-space-size=8192 memcached.js
var config ={
port: 11211,
max_memory: 300 // default 100M bytes
}
var net = require('net');
var LRU = function (max) { // this LRU implementaion is based on https://github.com/chriso/lru
@Gab-km
Gab-km / github-flow.ja.md
Last active April 23, 2024 09:52 — forked from juno/github-flow.ja.md
GitHub Flow (Japanese translation)

GitHub Flow

31 Aug 2011

git-flowの問題点 (Issues with git-flow)

私は人々にGitを教えるためにあちこちを飛び回っているが、最近のほぼすべてのクラスやワークショップで git-flow についてどう思うかを尋ねられた。私はいつも、git-flowは素晴らしいと思うと答えている。何百万ものワークフローを持ったシステム(Git)を提供し、ドキュメントもあるし、よくテストされている。フレキシブルなワークフローは、実に容易なやり方で多くの開発者の役に立つ。標準的なものになりつつあり、開発者はプロジェクトや企業の間を移動しつつこの標準的なワークフローに馴染むことができる。

@zentooo
zentooo / grunt.js
Created September 17, 2012 17:32
grunt.js for XXX
module.exports = function(grunt) {
var now = String(Date.now());
var jsResult = "<%= dirs.js %>/target/" + now + ".js";
var cssResult = "<%= dirs.css %>/target/" + now + ".css";
var jsGzipped = jsResult + ".gz";
var cssGzipped = cssResult + ".gz";
var compressFiles = {};
compressFiles[jsGzipped] = jsResult;