Skip to content

Instantly share code, notes, and snippets.

💭
🍛

teitei-tk teitei-tk

Block or report user

Report or block teitei-tk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:3425748
(function(){
var images = [
"http://24.media.tumblr.com/tumblr_li92qz4NtI1qhhb8uo1_400.jpg",
"http://24.media.tumblr.com/tumblr_m80ziwHwTZ1qz6rb1o1_500.jpg",
"http://25.media.tumblr.com/tumblr_m7m1lm8nqe1qbyxr0o1_500.png"
];
for (var i = 0, cnt = images.length; i < cnt; i++) {
new Image().src = images[i];
}
@teitei-tk
teitei-tk / yahooTextParseApiSample.php
Created Oct 22, 2012
Yahoo形態素解析APIのサンプル的なもの
View yahooTextParseApiSample.php
<?php
$appid = "APP_ID";
$sentence = mb_convert_encoding("シュレーディンガーの猫(しゅれーでぃんがーのぬこ)とは、平行宇宙に無限に自分の虚像を投射することで存在していると考えられている、猫のような生物(UMA)ないし「存在」、もしくは「現象」あるいは「箱」である。「わけのわからないもの」とも。", 'utf-8', 'auto');
$filter = "1|2|3|4|5|9|10";
$data = http_build_query(array(
"appid" => $appid,
"sentence" => $sentence,
"filter" => $filter,
"result" => "ma"
View fizzbuzz.js
(function(){
console.log( "start fizzbuzz...\n" );
var fizzbuzz, result = [];
for ( var i = 1; i <= 100; i++ ) {
if ( i % 3 === 0 && i % 5 === 0 ) {
fizzbuzz = "fizzbuzz";
} else if ( i % 3 === 0 ) {
fizzbuzz = "fizz";
View requirements.txt
Flask==0.6.1
IPy==0.81
Jinja2==2.7
MarkupSafe==0.18
PIL==1.1.7
Powerline==beta
Pygments==1.6
Twisted==12.0.0
Werkzeug==0.8.3
altgraph==0.9
@teitei-tk
teitei-tk / gist:8777464
Created Feb 3, 2014
str型の文字を一文字ずつ書き出す
View gist:8777464
#/usr/bin/env python
def run():
target = "1234567890"
length = len(target)
for x in xrange(0, length):
print target[x-1:x]
if __name__ == "__main__":
run()
View random_string.py
#!/usr/bin/env python
def random_string():
import string, random
return ''.join([random.choice(string.ascii_letters + string.digits) for i in range(50)])
if __name__ == "__main__":
print random_string()
@teitei-tk
teitei-tk / class.py
Created Feb 20, 2014
class methodの継承で一瞬迷ったのでおさらい。
View class.py
#!/usr/bin/env python
class Hoge(object):
def run(self):
print "run as Hoge"
def second_run(self):
print "run as Hoge"
class Foo(Hoge):
@teitei-tk
teitei-tk / tweenPositionTest.cs
Created Feb 21, 2014
NGUI TweenPosition Example x 座標0 or 350にDURATION分の時間を使いながら移動。
View tweenPositionTest.cs
using UnityEngine;
public class TweenPositionTest : MonoBehaviour
{
private GameObject tweenTarget;
public const float DURATION = 0.1f;
public void Start()
{
this.tweenTarget = GameObject.Find("TweenTarget");
View m4a_to_mp3.py
#!/usr/bin/env python
import sys
import os
import commands
import glob
import fnmatch
def recursive_glob(treeroot, pattern):
results = []
@teitei-tk
teitei-tk / gist:3ce7bdf5a4971c11154f
Created May 2, 2014
gitのローカルブランチで特定の文字を含んでいるブランチを強制削除
View gist:3ce7bdf5a4971c11154f
# hoge branchを削除
git branch | grep hoge | xargs -I % git branch -D %
You can’t perform that action at this time.