Skip to content

Instantly share code, notes, and snippets.

@yawara
yawara / graph-tool.rb
Last active August 29, 2015 14:24 — forked from jiayun/graph-tool.rb
require 'formula'
class GraphTool < Formula
homepage 'http://graph-tool.skewed.de/'
url 'http://downloads.skewed.de/graph-tool/graph-tool-2.2.31.tar.bz2'
sha1 '5e0b1c215ecd76191a82c745df0fac17e33bfb09'
head 'https://github.com/count0/graph-tool.git'
depends_on 'pkg-config' => :build
depends_on 'boost' => 'c++11'
@yawara
yawara / file0.txt
Created January 27, 2016 09:24
MacOSXにOpenJTalkを導入する。 ref: http://qiita.com/yawara/items/fe165636847b18e51def
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@yawara
yawara / file0.txt
Created January 27, 2016 09:38
メモ:iPython3でreloadを有効にする。 ref: http://qiita.com/yawara/items/5c9f1190080644dd9816
In [1]: %load_ext autoreload
In [2]: %autoreload 2
In [3]: from foo import some_function
In [4]: some_function()
Out[4]: 42
In [5]: # foo.pyを開いてsome_functionが43を返すように変更すると
@yawara
yawara / file0.txt
Created January 27, 2016 18:31
Debian 7 WheezyにCUDA 7.5をインストールする。 ref: http://qiita.com/yawara/items/a2eef8f9074f0a1e4261
> cat /etc/issue
Debian GNU/Linux 7 \n \l
> uname -a
Linux debian 3.2.0-4-amd64 #1 SMP Debian 3.2.73-2+deb7u2 x86_64 GNU/Linux
@yawara
yawara / btsync.conf
Created June 27, 2016 22:51
upstart init script for btsync
description "BitTorrent Sync"
author "Yawara ISHIDA"
start on filesystem or runlevel [2345]
stop on shutdown
script
CONFIG="/etc/btsync/btsync.conf"
BTSYNC="/usr/lib/btsync-core/btsync"
exec su ywr -c "$BTSYNC --nodaemon --config $CONFIG"
@yawara
yawara / caesar.py
Created July 13, 2016 14:39
Caesar Crypto
import string
def caesar(plaintext, shift):
alphabet_lower = string.ascii_lowercase
alphabet_upper = string.ascii_uppercase
alphabet = alphabet_lower + alphabet_upper
shifted_alphabet = alphabet_lower[shift:] + alphabet_lower[:shift] + alphabet_upper[shift:] + alphabet_upper[:shift]
table = str.maketrans(alphabet, shifted_alphabet)
return plaintext.translate(table)