Skip to content

Instantly share code, notes, and snippets.

View hagino3000's full-sized avatar

Takashi Nishibayashi hagino3000

View GitHub Profile
@aodag
aodag / instoru-paison
Created May 3, 2014 13:57
veriy simple python installer
#!/bin/sh
# -*- mode:sh -*-
version=$1
if [ "x$1" = "x" ] ; then
exit 1
fi
major=$(echo $version | awk -F "." '{print $1}')
minor=$(echo $version | awk -F "." '{print $2}')
micro=$(echo $version | awk -F "." '{print $3}')
tagged branch
defined#milestone#2011automn
taichi#task#001
closed#task#002
defined#ticket#003
ブランチ名にメタデータを含んだ状態にする。
単に名前付けするよりも長くなる傾向にあるとは思うものの、DB無しで状態管理出来るし、
既存のGitクライアントからでも状態変更出来る。
function declitimg(img) {
var cv = document.createElement('canvas');
cv.width = img.width;
cv.height = img.height;
var ctx = cv.getContext('2d');
ctx.drawImage(img, 0, 0);
var imd = ctx.getImageData(0, 0, img.width, img.height);
var s = '';
for (var i = 0; i < imd.data.length && imd.data[i] !== 0;) {
var c1 = imd.data[i++];
@shigeki
shigeki / http-request_rev.js
Created May 24, 2012 12:45
Node.js HTTP Request Sample Code
var http = require('http');
var ran = 0;
var queryNum = 100;
var parallel = 10;
var agent = new http.Agent({maxSockets: parallel});
if (process.argv.length != 5) {
console.error('usage: node http-request.js host port url\n' +
'ex). node http-request.js example.com 8080 /index.html');
process.exit(-1);
@katzchang
katzchang / Makefile
Last active October 13, 2015 20:28
gauche unitを書いた
GOSH=/usr/local/bin/gosh
L=./gu.scm
test:
$(GOSH) -l $(L) ./*test.scm
@esehara
esehara / simpleoptiontype.py
Created July 30, 2013 04:30
Option型のPython的実装
# -*- coding: utf-8 -*-
class SimpleOption(object):
NOTHING = False
SOME = True
def __init__(self, is_some, value=None):
@KunihikoKido
KunihikoKido / objectcache.py
Created August 1, 2013 08:10
Django キャッシュサーバーへ、Python オブジェクトをキャッシュ
# -*- coding: utf-8 -*-
import hashlib
try:
import cPickle as pickle
except ImportError:
import pickle
class PythonObjectCache(object):
@classmethod
@yuu-ito
yuu-ito / R_mvpart_package.md
Last active December 26, 2015 20:39
mvpart package サンプル

mvpart package サンプル

  • iris(あやめ)の大きな3枚のはなびらは,「Sepal がく片」
  • 小さな3枚のはなびらが,「Petal 花びら」である.
  • Sepal「がく片」の長さと幅・Petal「花びら」の長さと幅
  • Species「あやめ3品種 [setosa・versicolor・virginica]」
data(iris)
@shikajiro
shikajiro / gist:3041123
Created July 3, 2012 17:15
Google SpreadsheetをJSONを返すダミーサーバーとして利用する方法
###
GoogleShpreadsheetのシートに記述されたデータをDBのテーブルに見立て取得し、
JSONに変換するスクリプト。
このソースはTitanium Mobileを想定しているが、コンバートの処理は流用できる。
テストに使用しているShpreadsheetは以下
https://docs.google.com/spreadsheet/ccc?key=0AuCUD7G5hGZrdGlBbHBDVElfUXdsbWRkRThVcmdCalE
条件:1行目をカラム名にすること
LEFT JOINなどの処理は別途本気出して実装する必要あり。
@tkarpinski
tkarpinski / github_issues_to_csv.rb
Created April 12, 2012 18:09 — forked from henare/github_issues_to_csv.rb
Exports Github issues to CSV (API v3)
require 'octokit'
require 'csv'
require 'date'
# Github credentials to access your private project
USERNAME="USER_NAME"
PASSWORD="SEKRIT"
# Project you want to export issues from
USER="REPO_OWNER"
PROJECT="REPO_NAME"