Skip to content

Instantly share code, notes, and snippets.

View griffin-stewie's full-sized avatar

griffin-stewie griffin-stewie

View GitHub Profile
@koseki
koseki / jp-prefectures.html
Last active January 31, 2024 11:35
Japanese Prefectures 日本の都道府県 Text, JS, HTML 漢字, ローマ字, 都道府県コード
<select>
<option value="1">Hokkaido</option>
<option value="2">Aomori</option>
<option value="3">Iwate</option>
<option value="4">Miyagi</option>
<option value="5">Akita</option>
<option value="6">Yamagata</option>
<option value="7">Fukushima</option>
<option value="8">Ibaraki</option>
<option value="9">Tochigi</option>
@hetima
hetima / 01_setMenuProxy.m
Created July 27, 2011 10:27
WebKit2 context menu hack
// based on http://d.hatena.ne.jp/uasi/20110722/1311275712
IMP orig_setMenuProxy;
// オリジナルの setMenuProxy: と差し替えるメソッド
void ST_setMenuProxy(id self, SEL _cmd, void *menuProxy)
{
// オリジナルのメソッドを呼んでやる
orig_setMenuProxy(self, _cmd, menuProxy);
// menuProxy は WebContextMenuProxyMac クラスのポインタ
@hetima
hetima / safari_cmenu_item_tags.txt
Created July 31, 2011 16:00
Safari 5.1 context menu item tags
戻る, 9
進む, 10
ページを再読み込み, 10018
Dashboard で開く..., 10031
-
ソースを表示, 10019
ページを別名で保存..., 10021
ページをプリント..., 10025
-
要素の詳細を表示, 2024
@akisute
akisute / UIApplication+UIID.h
Created August 22, 2011 01:16
Unique Installation Identifier (UIID) as a replacement of the depreciated UDID. Repository available here: https://github.com/akisute/UIApplication-UIID
//
// UIApplication+UIID.h
// UIID
//
// Created by akisute on 11/08/22.
//
#import <UIKit/UIKit.h>
@matsuda
matsuda / gist:1161588
Last active September 26, 2015 21:27
Objective-CのUIView関連のスニペット
/*
UIWebViewのUserAgentを取得
*/
UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectZero];
NSString *ua = [webView stringByEvaluatingJavaScriptFromString:@"navigator.userAgent"];
NSLog(@"userAgent >>> %@", ua);
[webView release];
// ASIHTTPRequestにUserAgentを設定
// [ASIHTTPRequest setDefaultUserAgentString:ua];
import os
import csv
from subprocess import Popen, PIPE
from Foundation import NSMutableDictionary
build_number = os.popen4("git rev-parse --short HEAD")[1].read()
info_plist = os.environ['BUILT_PRODUCTS_DIR'] + "/" + os.environ['WRAPPER_NAME'] + "/Info.plist"
# Open the plist and write the short commit hash as the bundle version
plist = NSMutableDictionary.dictionaryWithContentsOfFile_(info_plist)
@michaelfox
michaelfox / README.md
Created September 9, 2011 16:06
Notational Velocity (nvAlt) Custom Stylesheet and Markup HTML

Usage

Copy these files to your ~/Library/Application Support/Notational Velocity/ folder

static inline NSString *convertSelName(const char *hax3d) {
int length = strlen(hax3d);
char name[length + 1];
for (int i = 0; i < length; ++i) {
char c = hax3d[i];
if (c == ':' || c == '_') {
name[i] = c;
} else if (c >= 'a' && c <= 'z') {
name[i] = ((c - 'a' + 13) % 26) + 'a';
@cockscomb
cockscomb / growlichat.scpt
Created October 4, 2011 11:02
Growl when new message arrived.
using terms from application "iChat"
on message received this_message from this_buddy for this_chat
(*EXAMPLE: this routine automatically sends a random response to messages from specified buddies
set this_name to the name of this_buddy
if the name of this_buddy is in {"Johnny Appleseed"} then
set canned_responses to {"Oh, I know!", "I was just thinking about that.", "Maybe tomorrow.", "Seems logical."}
set this_response to some item of the canned_responses
send this_response to this_chat
end if
*)
@Watson1978
Watson1978 / kill_apps.rb
Created October 8, 2011 08:43
MacRuby : terminate the running applications
framework 'AppKit'
IGNORE = {
'com.apple.finder' => true,
'com.apple.Terminal' => true,
}
apps = NSWorkspace.sharedWorkspace.runningApplications
apps.each do |app|
if app.activationPolicy == NSApplicationActivationPolicyRegular
app.terminate unless IGNORE[app.bundleIdentifier]