Skip to content

Instantly share code, notes, and snippets.

View teitei-tk's full-sized avatar
💭
I 💟 🍛

Yoshikatsu Higa teitei-tk

💭
I 💟 🍛
View GitHub Profile
@teitei-tk
teitei-tk / app.py
Created September 14, 2014 16:06
CentOS上でFlaskをpython3.4、Gunicorn + Nginxで動かす。 ref: http://qiita.com/teitei_tk/items/b223eeef1286a9fd7486
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
@teitei-tk
teitei-tk / gist:506a526bd7c55b49befd
Created September 10, 2014 06:34
delete git all local branches
git branch | awk "{print$1}" | xargs git branch -D
@teitei-tk
teitei-tk / file0.txt
Created September 7, 2014 16:47
GulpでCoffeeScript、Sassをコンパイル ref: http://qiita.com/teitei_tk/items/6a9833e4308b3769811d
$ npm install -g gulp
$ npm install --save-dev gulp gulp-coffee gulp-sass
import base64
from Crypto import Random
from Crypto.Cipher import AES
class AESCipher(object):
def __init__(self, key, block_size=32):
self.bs = block_size
if len(key) >= len(str(block_size)):
self.key = key[:block_size]
else:
[alias]
detect-branches = !git checkout $(git branch | peco)
@teitei-tk
teitei-tk / Rakefile
Created June 16, 2014 13:37
Rakefileにunicorn起動・停止のコマンドを追加する ref: http://qiita.com/teitei_tk/items/2f997d1b916905da6c80
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 June 15, 2014 15:32
Railsでvendor/assets/javascripts以下にあるファイルを特定のページでのみ使用する ref: http://qiita.com/teitei_tk/items/bf444c6aa6398bde83bf
....
<%= javascript_include_tag 'hoge.js', 'data-turbolinks-track' => true %>
....
@teitei-tk
teitei-tk / application.css
Created June 10, 2014 14:36
Railsでtwitter bootstrapをsubmoduleとして管理 ref: http://qiita.com/teitei_tk/items/a3810a89233dc54a3277
/*
* 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
@teitei-tk
teitei-tk / database.yml
Created June 7, 2014 09:01
Vagrant(CentOS6.5)にRails4.1 + Nginx + Unicorn + MySQL環境でRailsを起動する。 ref: http://qiita.com/teitei_tk/items/74794983d9893c3e7a05
default: &default
adapter: mysql2
encoding: utf8
pool: 5
username: hoge
password: foobar
socket: /var/lib/mysql/mysql.sock
@teitei-tk
teitei-tk / invoke.cs
Created May 20, 2014 03:58
1秒間隔で処理を実行する
using UnityEngine;
using System;
public class InvokeCotroller : MonoBehaviour
{
public void Start()
{
this.InvokeRepeating("Hoge", 0f, 1.0f);
}