Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I 💟 🍛

teitei-tk teitei-tk

💭
I 💟 🍛
View GitHub Profile
@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 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];
}
View gist:187a36cf01d50f15be1e
<?php
$txt = 'Mozilla/5.0 (iPhone; CPU iPhone OS 8_3 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12F70 Safari/600.1.4';
$reg = '/iPhone OS ([0-9]+)_([0-9]+)/i';
preg_match($reg, $txt, $result);
$str_version = $result[1] . '.' . $result[2]; //This variable should now contain : 4.0
var_dump($result);
View gist-file0.txt
set nohud
set nosmoothscroll
set typelinkhints
let searchlimit = 100
let scrollstep = 200
View file0.txt
[alias]
restart = reset --hard HEAD
@teitei-tk
teitei-tk / app.py
Created Sep 14, 2014
CentOS上でFlaskをpython3.4、Gunicorn + Nginxで動かす。 ref: http://qiita.com/teitei_tk/items/b223eeef1286a9fd7486
View app.py
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
@teitei-tk
teitei-tk / gist:506a526bd7c55b49befd
Created Sep 10, 2014
delete git all local branches
View gist:506a526bd7c55b49befd
git branch | awk "{print$1}" | xargs git branch -D
View file0.txt
$ npm install -g gulp
$ npm install --save-dev gulp gulp-coffee gulp-sass
@teitei-tk
teitei-tk / Rakefile
Created Jun 16, 2014
Rakefileにunicorn起動・停止のコマンドを追加する ref: http://qiita.com/teitei_tk/items/2f997d1b916905da6c80
View Rakefile
require File.expand_path('../config/application', __FILE__)
Rails.application.load_tasks
namespace :unicorn do
##
# Tasks
##
desc "Start unicorn"
@teitei-tk
teitei-tk / application.html.erb
Created Jun 15, 2014
Railsでvendor/assets/javascripts以下にあるファイルを特定のページでのみ使用する ref: http://qiita.com/teitei_tk/items/bf444c6aa6398bde83bf
View application.html.erb
....
<%= javascript_include_tag 'hoge.js', 'data-turbolinks-track' => true %>
....
You can’t perform that action at this time.