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:187a36cf01d50f15be1e
$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
View gist-file0.txt
set nohud
set nosmoothscroll
set typelinkhints
let searchlimit = 100
let scrollstep = 200
View file0.txt
restart = reset --hard HEAD
teitei-tk /
Created Sep 14, 2014
CentOS上でFlaskをpython3.4、Gunicorn + Nginxで動かす。 ref:
from flask import Flask
app = Flask(__name__)
def hello():
return "Hello World!"
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
View .gitconig
detect-branches = !git checkout $(git branch | peco)
teitei-tk / Rakefile
Created Jun 16, 2014
Rakefileにunicorn起動・停止のコマンドを追加する ref:
View Rakefile
require File.expand_path('../config/application', __FILE__)
namespace :unicorn do
# Tasks
desc "Start unicorn"
teitei-tk / application.html.erb
Created Jun 15, 2014
Railsでvendor/assets/javascripts以下にあるファイルを特定のページでのみ使用する ref:
View application.html.erb
<%= javascript_include_tag 'hoge.js', 'data-turbolinks-track' => true %>
teitei-tk / application.css
Created Jun 10, 2014
Railsでtwitter bootstrapをsubmoduleとして管理 ref:
View application.css
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any styles
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
You can’t perform that action at this time.