Skip to content

Instantly share code, notes, and snippets.

View hiroakit's full-sized avatar

hiroakit hiroakit

  • Japan
View GitHub Profile
@hiroakit
hiroakit / makefile
Created January 11, 2013 13:26
ユニバーサルな静的ライブラリを作るmakefileを作りました. https://github.com/Inferis/ViewDeck のコミットab62d8e6b0a4a8d1e606f58bebf4cf0e8cc2816eを使っています. なお,上記のコミットには静的ライブラリを生成できるプロジェクトファイルが含まれていません. 従って,このmakefileを実行する前に,自分でプロジェクトファイルを用意する必要があります. (Xcodeで新規プロジェクト生成時に選択できるCocoa Touch Static Libraryを利用するのが楽だと思います)
TARGET = ViewDeck
PROJECT = $(TARGET).xcodeproj
LIB_NAME = lib$(TARGET)
BUILD_CONFIG = Release
BUILD_DIR = ./build
OUTPUT_DIR = $(BUILD_DIR)
OUTPUT_FILE = $(TARGET)
default: init
@hiroakit
hiroakit / BanquetPolicy
Last active December 16, 2015 01:19
自分が宴会幹事になったときのポリシー.
自分が宴会幹事になったときのポリシー.
1. 居酒屋が入っている建物に、他にはどんなお店が入っているかを確認する
2. 次の日に仕事がある場合、制限時間を設ける (19:00 - 21:00)
3. メモを取るための道具をポケットに忍ばせておく (店員ではなく、幹事に注文する人が居る)
4. 予約する際は、可能な限り個室にする (個室以外だと、こそこそ話がしづらい)
5. 乾杯前、集団のまとめ役に挨拶を頂戴する (いきなり乾杯すると、ブチギレする人が居る)
@hiroakit
hiroakit / Setup play framework
Created October 13, 2013 01:31
setup play framework
$ sudo mkdir /usr/local/play
$ sudo mv $HOME/Download/play-2.2.0 /usr/local/lib/play/2.2.0
$ sudo chown -R root:admin /usr/local/lib/play
$ sudo chmod -R g+w /usr/local/lib/play/2.2.0
$ sudo ln -s /usr/loca/lib/play/2.2.0/play /usr/local/bin/play
$ emacs $HOME/.zshrc
export PATH=$PATH:/usr/local/bin/play
$ play help // 動作確認
@hiroakit
hiroakit / JavaToDoList-ChangeToPostgreSQL
Last active December 25, 2015 14:49
このGistにはJavaToDoList ( http://www.playframework-ja.org/documentation/2.1.5/JavaTodoList ) の内容を、データベースをPostgreSQLに変更する際に必要なコード修正について記述しました。(修正が必要な3ファイルの内容を一つにまとめています)
// Task.javaを修正する
package models;
import java.util.*;
import play.db.ebean.*;
import play.data.validation.Constraints.*;
import javax.persistence.*;
@Entity
public class Task extends Model {
@hiroakit
hiroakit / rbenvSetup.sh
Last active January 1, 2016 16:29
rbenv、ruby-buildおよびrbenvを使ってrubyをインストールするためのスクリプト。動作環境にMacPortsとgitが必要です。Mac OS X Mountain Lionで動作確認済み。このスクリプトを実行した後に $ rbenv global 2.0.0-p353 (rubyのバージョンは任意) とコマンドを叩く必要があります。
#!/bin/sh
# LICENSE
#
# rbenv setup assistance
# Copyright (C) 2013 Hiroaki ENDOH
#
# This program is free software; you can redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
@hiroakit
hiroakit / pyenvSetup.sh
Created July 5, 2014 11:32
pyenv (https://github.com/yyuu/pyenv) のセットアップ用シェルスクリプト。Mac OS X Mavericksでのみ動作確認をしています。
#!/bin/sh
# LICENSE
#
# pyenv setup assistant
# Copyright (C) 2014 Hiroaki ENDOH
#
# This program is free software; you can redistribute it and/or modify it under the terms of the GNU
# General Public License as published by the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
import maya.api.OpenMaya as om
def maya_useNewAPI():
pass
class HelloWorld(om.MPxCommand):
kPluginCmdName = "HelloWorld"
def __init__(self):
om.MPxCommand.__init__(self)
export MAYA_PLUG_IN_PATH="path/to/plug-ins"
@hiroakit
hiroakit / parse-iis-log.sh
Created July 26, 2015 00:03
IISのログをシンプルにするシェルスクリプト(bash)
if [ $# -ne 1 ]; then
echo "パスをダブルクォートで囲って指定してください。" 1>&2
exit 1
fi
files=$1
for filepath in $files; do
echo $filepath
done
@hiroakit
hiroakit / PlayPolyPlane.py
Created August 2, 2015 11:57
create polyplane, move, scale, rotate
import maya.cmds as cmds
cmds.polyPlane(n='myPlane1', sx=1, sy=1, w=1.0, h=1.0)
# 他にもこういったコマンドでオブジェクトを生成できる
# cmds.polyCube( n='myCube1', sx=1, sy=1, sz=1, w=1.0, h=1.0)
# cmds.polySphere(n='mySphere1', sx=1, sy=1, r=1.0)
# cmds.polyCylinder(n='myCylinder1', sx=1, sy=1, sz=1, h=1.0)
# 生成したオブジェクトを移動、拡大、回転させる
cmds.move( 5, 0, 0, 'myPlane1', r=True )