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
View ansible-create-role.sh
#!/bin/sh
# Create role directory following in Ansible's best practices
# http://docs.ansible.com/playbooks_best_practices.html#directory-layout
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
mookjp / mac-java_home.md
Last active Aug 29, 2015
MacでJAVA_HOMEの切り替え
View mac-java_home.md

$ 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`
View github-credencials.md

GitのHTTP認証が面倒なときの解決策

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

1. 認証の設定を書く

gitconfigに下記の記述を加えます。

@mookjp
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"
else
puts "Your number is low\n"
end
@mookjp
mookjp / vividred.py
Last active Dec 12, 2015
レッッビビドド・ョペオレーンシ
View vividred.py
# -*- 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
mookjp / gist:3756049
Created Sep 20, 2012
Script generating mynt template with date
View gist:3756049
#!/bin/sh
# Generate mynt template file with filename.
# The argument should be the title of the article.
filename=`date +%Y-%m-%d`-$1.md
touch $filename
cat <<_EOT_ > $filename
---
You can’t perform that action at this time.