This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation MyUIViewController | |
- (void)showOnView:(UIView*)parent_{ | |
if( !self.view.superview ) [self retain]; | |
self.view.alpha = 0.0; | |
[parent_ addSubview:self.view]; | |
[UIView animateWithDuration:1.0 | |
animations:^(){ | |
self.view.alpha = 1.0; | |
} | |
completion:^(BOOL finished){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# created date : 2012/09/29 15:36:38 | |
# last updated : 2012/09/29 17:10:29 | |
# 引数で渡されたファイル名の拡張子を小文字にする | |
# ex. test.JPG -> test.jpg HOGE.BIG -> HOGE.big | |
# usage: | |
# $ rename_to_lower_ext.sh * | |
# 引数チェック | |
if [ $# -eq 0 ] ; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# created date : 2012/03/25 16:39:16 | |
# last updated : 2012/09/29 17:41:05 | |
# 画像ファイルのファイル名先頭に撮影日を追加。 | |
# ex. test.jpg -> 2012_03_25_test.jpg | |
# 2012_03_25_test.jpg -> 2012_03_25_test.jpg (不変) | |
# usage: | |
# $ rename_jpg.sh *.jpg | |
# 引数チェック |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)setKeyboardNotification{ | |
NSNotificationCenter *c = [NSNotificationCenter defaultCenter]; | |
[c addObserver:self selector:@selector(notifKeyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; | |
[c addObserver:self selector:@selector(notifKeyboardWillHide:) name:UIKeyboardWillHideNotification object:nil]; | |
} | |
- (void)unsetKeyboardNotification { | |
NSNotificationCenter *c = [NSNotificationCenter defaultCenter]; | |
[c removeObserver:self name:UIKeyboardWillShowNotification object:nil]; | |
[c removeObserver:self name:UIKeyboardWillHideNotification object:nil]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zip -Xr9D data.epub mimetype * -x make_epub.bat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; if .file.swp exists : | |
;; set buffer-read-only and ask to user | |
(defun check-vi-swp-file () | |
(let* ((fullpath (file-truename (buffer-file-name))) | |
(dirpath (file-name-directory fullpath) ) | |
(fname (file-name-nondirectory fullpath) ) | |
(swppath (concat dirpath "." fname ".swp") )) | |
(if (file-exists-p swppath) | |
(progn | |
(setq buffer-read-only 't) ; set Read-Only. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for year in $(seq 1900 2050); do | |
if [ `cal 12 $year | head -n 3 | tail -n 1 | tr -d ' '` = "1" ] ; then | |
echo $year; | |
fi; | |
done; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ファイル名以外の引数無効。 | |
# チェックしてない | |
s-less() { | |
if [ -n "$1" ];then | |
# 引数あり | |
nkf -s $@ | less | |
else | |
# 引数なし | |
less | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; add-to-list のマクロ | |
(defmacro append-to-list (to lst) | |
`(progn (mapcar (lambda (arg) (add-to-list ,to arg)) ,lst) | |
(eval ,to))) | |
;;; Usage | |
;; load-path 追加 | |
(setq nom-slispd "/path/to/site-lisp" | |
(append-to-list 'load-path | |
(list nom-slispd |
OlderNewer