Skip to content

Instantly share code, notes, and snippets.

View gamame's full-sized avatar

Yusuke Hikime gamame

View GitHub Profile
@gamame
gamame / file0.txt
Created June 5, 2014 01:24
Ansibleでホストを限定して実行する。 ref: http://qiita.com/dondoco7/items/44bce47c5f0a21aab419
-l <pattern> or --limit=<pattern>

rbenvとruby-buildでRuby環境を最新に保つのんなー

更新日:2014/2/25

rbenv, ruby-buildを更新

$ cd ~/.rbenv
$ git pull origin master
$ cd ~/.rbenv/plugins/ruby-build
$ git pull origin master
@gamame
gamame / gist:11239830
Created April 24, 2014 02:51
rbenvでbrewのopensslとreadlineを使ってコンパイルさせる
RUBY_CONFIGURE_OPTS="--with-readline-dir=$(brew --prefix readline) --with-openssl-dir=$(brew --prefix openssl)" ; rbenv install <ruby_version>
@gamame
gamame / gist:8881701
Created February 8, 2014 10:38
Vagrantで複数ノード立ち上げ時にメモリーサイズを指定する
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
@gamame
gamame / 0_reuse_code.js
Created January 20, 2014 14:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@gamame
gamame / file0.txt
Created November 30, 2013 12:29
npmが、EMOT何とか言ってinstallできない。 ref: http://qiita.com/dondoco7/items/43d460a1d08cc790e7d6
npm clear cache
@gamame
gamame / file0.txt
Created November 25, 2013 10:37
Rspecでコントローラをテストした時にrenderを実行してくれない。 ref: http://qiita.com/dondoco7/items/c79e8e821e803859409c
describe ExamplesController do
render_views # コレをつけるとrenderを実行してくれる
end
@gamame
gamame / gist:5167073
Created March 15, 2013 02:31
pythonでFlatten
from itertools import chain
list(chain.from_iterable(l))
@gamame
gamame / avro_rw.py
Created May 17, 2012 01:45
Python Avro Data Read Write
# Import the schema, datafile and io submodules
# from avro (easy_install avro)
from avro import schema, datafile, io
OUTFILE_NAME = 'sample.avro'
SCHEMA_STR = """{
"type": "record",
"name": "sampleAvro",
"namespace": "AVRO",
@gamame
gamame / boto_mpupload_1
Created April 2, 2012 10:44 — forked from garnaat/boto_mpupload_1
An IPython transcript showing use of S3 MultiPart Upload in boto
In [1]: import boto
In [2]: c = boto.connect_s3()
In [3]: b = c.lookup('test-1245812163')
In [4]: mp = b.initiate_multipart_upload('testmpupload2')
In [5]: mp
Out[5]: <MultiPartUpload testmpupload2>