Skip to content

Instantly share code, notes, and snippets.

set -g prefix C-a
unbind C-b
# Split pane vertical
bind | split-window -h
# Split pane horizontal
bind - split-window -v
# キーストロークのディレイを減らす
import sys
import subprocess
def execute_subprocess(command):
process = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
while True:
line = process.stdout.readline()
if line:
@takp
takp / Dockerfile-torch-opencv
Last active April 25, 2018 02:27
Dockerfile installing Torch, OpenCV and Lua
FROM jjanzic/docker-python3-opencv
RUN apt-get install lua
&& curl -R -O http://www.lua.org/ftp/lua-5.3.4.tar.gz \
&& tar zxf lua-5.3.4.tar.gz \
&& cd lua-5.3.4 \
&& make linux test \
&& make install
RUN apt-get install sudo
@takp
takp / Create-instance-of-extended-simple-oauth.rb
Last active May 9, 2016 13:54
Create-instance-of-extended-simple-oauth.rb
ExtendedSimpleOAuth.new()
@takp
takp / simple-oauth-subclass.rb
Last active May 9, 2016 13:38
simple-oauth-subclass.rb
class ExtendedSimpleOAuth > SimpleOAuth::Header
class >> self
def escape(value)
return value if value == 'filter[post_status]'
super
end
end
end
module SimpleOAuth
class Header
class >> self
def escape(value)
return value if value == 'filter[post_status]'
uri_parser.escape(value.to_s, /[^a-z0-9\-\.\_\~]/i)
end
end
end
end
@takp
takp / simple-oauth-header-extract.rb
Last active May 9, 2016 13:38
simple-oauth-header-extract.rb
module SimpleOAuth
class Header
class >> self
...
def escape(value)
uri_parser.escape(value.to_s, /[^a-z0-9\-\.\_\~]/i)
end
alias_method :encode, :escape
@takp
takp / file0.txt
Last active April 19, 2016 06:34
AWS ElasticBeanstalk + RailsでCronを設定する ref: http://qiita.com/tak_nishida/items/912fda099e54b0292667
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
0 20 * * * root /var/script/sitemap.sh
@takp
takp / file0.txt
Last active April 13, 2016 08:55
AWS Elastic Beanstalk、Nginx + Passenger (standalone)の環境設定 ref: http://qiita.com/tak_nishida/items/cf30a2d373744943b943
$ passenger start --nginx-config-template nginx.conf.erb
@takp
takp / file0.txt
Last active February 5, 2016 15:38
Nginxでブラウザ言語判定してリダイレクトさせる方法 ref: http://qiita.com/tak_nishida/items/cc5ad5cb80a00d997b48
$ wget http://nginx.org/download/nginx-1.9.10.tar.gz
$ tar xvf nginx-1.9.10.tar.gz