Skip to content

Instantly share code, notes, and snippets.

mook mookjp

Block or report user

Report or block mookjp

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
# Create role directory following in Ansible's best practices
function show_usage() {
echo "usage: $0 [<the name of role>]"
exit 0
View Brewfile
brew 'ack'
brew 'apple-gcc42'
brew 'atk'
brew 'autoconf'
brew 'automake'
brew 'boost'
brew 'cairo'
brew 'clisp'
brew 'cloog'
brew 'cmake'
mookjp /
Last active Aug 29, 2015

$ export JAVA_HOME=`/usr/libexec/java_home -v <version>` でJAVA_HOMEの切り替えを行うことができる。

export JAVA_HOME=`/usr/libexec/java_home -v 1.6`
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`


GitのリモートリポジトリへHTTP認証を使ってアクセスしていると、 毎回ユーザー名・パスワードを求められるので面倒です。 この入力を回避するには下記の方法があります。

1. 認証の設定を書く


mookjp / rand.rb
Last active Dec 13, 2015
DAY1, Ruby - Seven languages self study
View rand.rb
random_num = rand(10)
puts "Random number is " + random_num.to_s + "\n"
if gets.to_i > random_num
puts "Your number is high\n"
puts "Your number is low\n"
mookjp /
Last active Dec 12, 2015
# -*- coding: utf-8 -*-
import random
def vivid():
return u''.join([ ''.join(random.sample(item, len(item))) for item in [ list(item) for item in u'ビビッドレッド・オペレーション'.split(u'') ] ])
if __name__ == '__main__':
# Infinite loop
while True:
print vivid()
mookjp / gist:3756049
Created Sep 20, 2012
Script generating mynt template with date
View gist:3756049
# Generate mynt template file with filename.
# The argument should be the title of the article.
filename=`date +%Y-%m-%d`-$
touch $filename
cat <<_EOT_ > $filename
You can’t perform that action at this time.