Skip to content

Instantly share code, notes, and snippets.

View mazgi's full-sized avatar

Hidenori Matsuki mazgi

View GitHub Profile
@mazgi
mazgi / NSInvocationSample.m
Created March 26, 2012 04:31
NSInvocationを使ってメッセージ送信するサンプル
#import <Foundation/Foundation.h>
/*!
@header
@abstract NSInvocationを使ってメッセージ送信するサンプル
@disucussion Cocoaじゃないと動かないと思います
*/
@interface TestObj : NSObject
- (void)run;
- (BOOL)foo:(BOOL)value;
@end
@mazgi
mazgi / gist:2249596
Created March 30, 2012 08:26
Xcodeでビルド時のリビジョン取得するのにこーゆースクリプトを登録してる
REVISION=$(svn info 2> /dev/null | grep Revision | sed -e 's/Revision: //')
if [ -z ${REVISION} ]; then
REVISION=$(git svn info 2> /dev/null | grep Revision | sed -e 's/Revision: //')
fi
if [ -z ${REVISION} ]; then
REVISION="no rev"
fi
cat<<EOH>Environment.h
#import <Foundation/Foundation.h>
#define REVISION @"${REVISION}"
@mazgi
mazgi / zshrc
Created May 15, 2012 00:19
MacOSX/Linuxあたりで使ってるzshrc
autoload colors
colors
UID_COLOR=${fg[green]}
case ${UID} in
0)
UID_COLOR=${fg[red]}
;;
*)
;;
@mazgi
mazgi / config
Created May 17, 2012 08:38
Xcode用~/.subversion/config
[auto-props]
Localizable.strings = svn:mime-type=text/plain;charset=UTF-16
@mazgi
mazgi / atnd_users_to_csv.rb
Created May 25, 2012 10:16
ATNDの参加者一覧を出力
#!/usr/bin/env ruby
require 'pp'
require 'optparse'
require 'net/http'
require 'json'
Version=0.5
class User
attr_accessor :atnd_name, :is_regular
@mazgi
mazgi / screenrc
Created June 1, 2012 07:36
/etc/screenrc
startup_message off
shell /bin/zsh
caption always "%{= wk} %-w%{=bu dr}%n %t%{-}%+w %= %{=b wb}%y/%m/%d(%D) %{=b wb}%c"
@mazgi
mazgi / App.pch
Created June 3, 2012 12:21
デバッグLOG出力
#ifdef DEBUG
extern void _objc_autoreleasePoolPrint();
#define _objc_autoreleasePoolPrint() _objc_autoreleasePoolPrint()
#define __BASENAME__ (strrchr(__FILE__, '/') + 1)
/*!
@define
@abstract デバッグ時のみ出力されるログ
@param 第一引数はフォーマット文字列、以降可変引数
*/
#define LOG(...) \
@mazgi
mazgi / .tmux.conf
Created June 4, 2012 07:32
~/.tmux.conf
set-option -g default-shell /bin/zsh
set-window-option -g mode-keys emacs
@mazgi
mazgi / make.conf
Created June 8, 2012 01:11
/etc/make.conf
CFLAGS="-O2 -pipe"
CXXFLAGS="${CFLAGS}"
CHOST="x86_64-pc-linux-gnu"
USE="mmx sse sse2"
USE="$USE bash-completion zsh-completion vim-syntax"
USE="$USE git"
SYNC="rsync://rsync.jp.gentoo.org/gentoo-portage"
@mazgi
mazgi / .ssh_config
Created June 11, 2012 00:39
rackhub用.ssh/config
Host *.rackbox.net
IdentityFile ~/.ssh/id_rsa.rackhub