Skip to content

Instantly share code, notes, and snippets.

View tai2's full-sized avatar
🐢

Taiju Muto tai2

🐢
View GitHub Profile
@tai2
tai2 / goodparts.js
Created January 29, 2014 18:30
From JavaScript: The Good Parts
if (typeof Object.inherit === 'undefined') {
Object.inherit = function(o) {
var F = function() {};
F.prototype = o;
return new F();
}
} else {
throw {'name' : 'Method Duplication', 'message' : 'Object.create already defined'};
}
@tai2
tai2 / slide.md
Last active August 29, 2015 14:00
ウルフギャングのチューニング過程まとめ
@tai2
tai2 / bsearch.js
Last active August 29, 2015 14:01
find insert position for sorted array
(function() {
Array.prototype['insertPos'] = function(val, cmp) {
var lower = 0;
var upper = this.length - 1;
var idx = Math.floor((lower + upper) / 2);
var ret;
if (this.length === 0) {
return 0;
@tai2
tai2 / http1.1.md
Last active August 29, 2015 14:01
Hypertext Transfer Protocol -- HTTP/1.1
@tai2
tai2 / gist:c8f45809a1cab7d44a27
Created June 5, 2014 12:43
Nexus5 supported codecs
name:OMX.qcom.video.encoder.mpeg4 isEncoder:true type:video/mp4v-es
name:OMX.qcom.video.encoder.h263 isEncoder:true type:video/3gpp
name:OMX.qcom.video.encoder.avc isEncoder:true type:video/avc
name:OMX.qcom.video.encoder.vp8 isEncoder:true type:video/x-vnd.on2.vp8
name:OMX.google.amrnb.encoder isEncoder:true type:audio/3gpp
name:OMX.google.aac.encoder isEncoder:true type:audio/mp4a-latm
name:OMX.google.amrwb.encoder isEncoder:true type:audio/amr-wb
name:OMX.google.flac.encoder isEncoder:true type:audio/flac
name:OMX.google.vp8.encoder isEncoder:true type:video/x-vnd.on2.vp8
name:OMX.google.vorbis.decoder isEncoder:false type:audio/vorbis
@tai2
tai2 / countdown.py
Last active August 29, 2015 14:02
Count down time and notify a message through Notification Center
#!/usr/bin/env python
import sys
import time
import re
import subprocess
if __name__ == '__main__':
period = sys.argv[1]
m = re.match('(.*)([smh])', period)
@tai2
tai2 / gist:989b41fa011a14d1431a
Last active August 29, 2015 14:04
Tizen開発環境構築
Mac OSX 10.9.4
tizen-sdk-mac64-v2.2.71.dmg バイナリが壊れてると言われた
tizen-sdk-mac64-cli-v2.2.71.bin 途中までいって失敗する
./tizen-sdk-mac64-v2.2.71.bin -install -f ./tizen-sdk-image-2.2.1-macos64.zip -p TYPICAL -l ~/Library/Developer/ -accept_license SDK image file does not have a package list file. Fatal error occurred.
Ubuntu 12.4
http://www.duinsoft.nl/packages.php?t=en の手順を実行 → エラー(メモってなかった)
sudo apt-get install oracle-java6-installer → エラー(メモってなかった)
sudo apt-get install oracle-java7-installer → エラー(メモってなかった)
@tai2
tai2 / sendpacket.py
Created August 15, 2014 07:27
Send a udp packet
#!/usr/bin/python
import socket
import sys
if __name__ == '__main__':
if len(sys.argv) < 3:
sys.stderr.write('require arguments. host port filename')
sys.exit(1)
host = sys.argv[1]
@tai2
tai2 / qsort.py
Created August 19, 2014 09:11
quick sort
import random
import timeit
import itertools
def is_sorted(a):
return all(a[i] <= a[i+1] for i in xrange(len(a)-1))
def qsort(a):
def impl(a, left, right):
if left >= right:
@tai2
tai2 / helloworld.c
Created August 23, 2014 09:27
Tizen AppCore Hello World
// gcc -o helloworld helloworld.c `pkg-config --cflags --libs appcore-efl`
#include <stdio.h>
#include <stdlib.h>
#include <appcore-efl.h>
#include <Ecore.h>
#include <Ecore_Evas.h>
#define WIDTH 1920
#define HEIGHT 1080