Skip to content

Instantly share code, notes, and snippets.

@i03nomura1y
i03nomura1y / iota.sh
Last active December 15, 2015 11:19
sh script: 連番を echo する。
#!/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
@i03nomura1y
i03nomura1y / ios_lockscreen_notification.m
Last active May 19, 2020 12:15
iOS LockScreen Notification
// 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]) {
// 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 !!');
})();