Skip to content

Instantly share code, notes, and snippets.

Sample

これはサンプルのリポジトリです。

Language

日本語大丈夫かな?Shift_JISはあやしいぽい。 専用エディタあればいいんだけどメモ帳で書いてみた。

この部分は 引用扱いされます

@tomoemon
tomoemon / gist:2716822
Created May 17, 2012 05:56
Ubuntu10.04にPython2.7をインストールするときに必要なライブラリ
sudo apt-get install libsqlite3-dev zlib1g-dev libbz2-dev libreadline-dev libncurses-dev libgdbm-dev libglobus-openssl-dev
pythonbrew使うと入れるの楽
http://www.ninxit.com/blog/2011/05/28/pythonbrew%E3%81%A7%E6%A7%8B%E7%AF%89%E3%81%99%E3%82%8Bpython%E9%96%8B%E7%99%BA%E7%92%B0%E5%A2%83/
$ echo "VIRTUALENVWRAPPER_PYTHON=py2.6.6" >> ~/.bashrc
は export を付ける
$ echo "export VIRTUALENVWRAPPER_PYTHON=py2.6.6" >> ~/.bashrc
@tomoemon
tomoemon / gist:2716912
Created May 17, 2012 06:14
UbuntuのPython2.7にlxmlをインストールするために必要なライブラリ
sudo apt-get install libxml2-dev libxslt1-dev
@tomoemon
tomoemon / gist:2818120
Created May 28, 2012 09:22
MySQL5.1.63のコンパイルオプション
./configure '--prefix=/usr/local/mysql51' '--enable-thread-safe-client' '--enable-local-infile' '--with-pic' '--with-fast-mutexes' '--with-client-ldflags=-static' '--with-mysqld-ldflags=-static' '--with-zlib-dir=bundled' '--with-big-tables' '--with-ssl' '--with-readline' '--with-embedded-server' '--with-plugins=innobase,partition,archive,blackhole,csv' '--with-extra-charsets=complex'
@tomoemon
tomoemon / gist:3331747
Last active October 8, 2015 12:27
MySQL5.5.27のコンパイルオプション
sudo cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql-5.5 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
# plugin の指定とかないし、バイナリインストールでぶっちゃけ問題ない
#バイナリインストールの場合
shell> groupadd mysql
shell> useradd -r -g mysql mysql
shell> cd /usr/local
shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz
shell> ln -s full-path-to-mysql-VERSION-OS mysql
shell> cd mysql
@tomoemon
tomoemon / gist:3337639
Created August 13, 2012 07:08
PHP5.4+apache2のインストール
http://grow.pe/dojo/tips/52/Ubuntu%E3%81%ABapt-get%E3%81%A7PHP54%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%99%E3%82%8B%E6%89%8B%E9%A0%86/
sudo apt-get install php5
sudo apt-get install apache2
sudo apt-get install libapache2-mod-php5
sudo apt-get install php5-mysql
# mysql はバイナリインストール(apt-getで入れても良い気がする)
# php本家を apt-get で入れたら、他の関係モジュールも apt-get で入れること。pdo を pecl で入れようとしたらエラー頻発でわけわからんことになった。
@tomoemon
tomoemon / jinja.py
Last active December 13, 2015 21:09
jinja2 strange operator priority
from jinja2 import Environment
env = Environment()
env.from_string("{% if x is sameas 100 and 1 %}xxx{% else %}yyy{% endif %}").render({"x": 100})
# => yyy
env.from_string("{% if (x is sameas 100) and 1 %}xxx{% else %}yyy{% endif %}").render({"x": 100})
# => xxx (expected)
env.from_string("{% if x is sameas (100 and 1) %}xxx{% else %}yyy{% endif %}").render({"x": 100})
# => yyy (actual)
@tomoemon
tomoemon / encoding.py
Created February 18, 2013 16:28
python various encoding
-*- coding: utf-8 -*-
import sys
import locale
sys.stdout.write(repr(sys.stdout.encoding) + "\n") # on redirecting, set None
sys.stdout.write(repr(sys.getdefaultencoding()) + "\n") # used as default encoding when encoding or decoding
sys.stdout.write(repr(sys.getfilesystemencoding()) + "\n")
sys.stdout.write(repr(locale.getpreferredencoding()) + "\n")
sys.stdout.write(u"あいうえお\n")
@tomoemon
tomoemon / gist:7132797
Last active December 26, 2015 09:49
mysql 5.6 INSTALL-BINARY
基本的に mysql 公式の手順と同じ
# create user
shell> sudo groupadd mysql
shell> sudo useradd -r -g mysql mysql
# download & install mysql
shell> wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.14-linux-glibc2.5-x86_64.tar.gz/from/http://cdn.mysql.com/ -O mysql-5.6.bin.tar.gz
shell> tar zxvf mysql-5.6.bin.tar.gz
shell> sudo mv mysql-5.6.14-linux-glibc2.5-x86_64 /usr/local
@tomoemon
tomoemon / gist:9304216
Last active August 29, 2015 13:56
Windows 上の IntelliJ で Scala を使えるようにする
  1. IntelliJ Community Edition をインストール
  2. IntelliJ の Scala plugin をインストールする
  3. Scala 本体をインストール
  • インストールオプションから Sources が抜けているのでチェックをつける
  • インストール先はスペースが入っていないディレクトリにする
  1. 環境変数に SCALA_HOME を追加する(値は Scala のインストール先ディレクトリ)
  2. IntelliJ を起動して Scala module のプロジェクトを作成しようとすると、document が入ってないと言われるため、IntelliJ が求める場所にシンボリックリンクを作成する
  • mklink /D %SCALA_HOME%/api %SCALA_HOME%/api