Skip to content

Instantly share code, notes, and snippets.

Avatar

Yoshiaki Kawazu kawaz

View GitHub Profile
@zentooo
zentooo / grunt.js
Created Sep 17, 2012
grunt.js for XXX
View grunt.js
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;
@Gab-km
Gab-km / github-flow.ja.md
Last active Aug 22, 2022 — forked from juno/github-flow.ja.md
GitHub Flow (Japanese translation)
View github-flow.ja.md

GitHub Flow

31 Aug 2011

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

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

@fxsjy
fxsjy / gist:3291755
Last active Jan 9, 2021
Memcached in JavaScript based on Node.JS
View gist:3291755
//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
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@utaani
utaani / seteth1.sh
Created Mar 22, 2012
ifconfig eth1 with fixed IP address on Amazon-VPC ENI(Elastic Network Interface)
View seteth1.sh
#!/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
@Jxck
Jxck / .gitignore
Created Sep 24, 2011
show repository status of modules listed on https://github.com/joyent/node/wiki/modules
View gist:921465
// 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);
@jed
jed / ATNDNT.js
Created Apr 2, 2011
a script that lets you know when your friends sign up for new ATND.org events
View ATNDNT.js
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 ) {
@kawaz
kawaz / GoogleSBM_kawaz.user.js
Created Mar 4, 2011
Google+SBM( http://userscripts.org/scripts/show/23906 )がニュースに対応してなかったのでXPathを修正したバージョン。
View GoogleSBM_kawaz.user.js
// ==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
@Takazudo
Takazudo / androidViewport.js
Created Jan 10, 2011
some androids can't handle meta viewport width=number.
View androidViewport.js
/*
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){