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
// GitHub Gist で js を書く -> GitHack 経由でロードする | |
// | |
// javascript:var%20s=document.createElement('script');s.src='https://gist.githack.com/i03nomura1y/29d337e56b979c125083adeb782f247a/raw/c954c29c207bbae8aa3b96ad7b08222495c654b1/alert_hello.js';document.body.appendChild(s); | |
(function(){ | |
alert('Hello, world !!'); | |
})(); |
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
// iOS ロックスクリーン Notification | |
#define NotifName_LockComplete @"com.apple.springboard.lockcomplete" | |
#define NotifName_LockState @"com.apple.springboard.lockstate" | |
//call back | |
static void lockStatusChanged(CFNotificationCenterRef center, void *observer, CFStringRef name_cf, const void *object, CFDictionaryRef userInfo){ | |
NSString *name = (__bridge NSString*)name_cf; | |
if ([name isEqualToString:NotifName_LockComplete]) { |
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 | |
# 2013/03/27 | |
# 連番を echo する。 | |
# $ ./iota.sh 10 => 000 .. 010 | |
# $ ./iota.sh 3 5 => 003 .. 005 | |
# $ ./iota.sh 3 5 "%d" => 3 .. 5 | |
# 追記: | |
# $ seq -w 3 10 |
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 |
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
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
;; 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
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
- (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]; | |
} |
NewerOlder