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
<?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
View .gitconig
[alias]
detect-branches = !git checkout $(git branch | peco)
@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 %>
....
@teitei-tk
teitei-tk / application.css
Created Jun 10, 2014
Railsでtwitter bootstrapをsubmoduleとして管理 ref: http://qiita.com/teitei_tk/items/a3810a89233dc54a3277
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.