Skip to content

Instantly share code, notes, and snippets.

NS_INLINE CGFloat NSWidth(NSRect aRect) {
return (aRect.size.width);
}
#define NSWidth(aRect) ({aRect.size.width;})
@hetima
hetima / gist:11212483
Created April 23, 2014 11:56
Reminders.app 実行するたび締め切りが延びる魔法のスクリプト
tell application "Reminders"
set reminderTitle to "Shimekiri"
set listTitle to "work"
set workerList to list listTitle
-- remove old reminder
set ids to {}
repeat with r in reminder of workerList
if name of r is reminderTitle then
@hetima
hetima / gist:465b897da0f03e9288b9
Last active August 29, 2015 14:00
KZRMETHOD_SWIZZLING_WITHBLOCK
#define KZRMETHOD_SWIZZLING_WITHBLOCK(className, selectorName, isClassMethod, originalIMP, originalSelector, block) {\
BOOL _val_isClassMethod=isClassMethod; \
const char* _val_selName=selectorName; \
if(*_val_selName=='+'){_val_isClassMethod=YES; _val_selName++;} \
Class _val_cls=objc_getClass(className); \
SEL originalSelector=sel_registerName(_val_selName); \
Method _val_originalMethod; \
if (_val_isClassMethod)_val_originalMethod = class_getClassMethod(_val_cls, originalSelector); \
else _val_originalMethod = class_getInstanceMethod(_val_cls, originalSelector); \
KZRIMPUnion originalIMP = (KZRIMPUnion)(IMP)method_getImplementation(_val_originalMethod); \
//Safari 7
struct WebContextMenuProxyMac {
CDUnknownFunctionPointerType *_field1;
unsigned int _field2;
struct RetainPtr<NSPopUpButtonCell> _field3;
id _field4;
struct WebPageProxy *_field5;
};
//Safari 8
@hetima
hetima / gist:8e8e06e02493d36e975a
Last active August 29, 2015 14:08
Yosemite Memo

##古いソフトの対応

  • VMware Fusion 6.0.5 問題なさげ
  • iStat Menus 3.2.7 温度センサー関連をインストールしなければ問題なさげ
  • LaunchBar 5.6 問題なさげ
  • かわせみ 1.1.5 問題なさげ
  • Audio Hijack Pro 2.11 問題なさげ

##リンク

@hetima
hetima / gist:14ea8987a50373706266
Last active August 29, 2015 14:08
Xcode 6.1 Documentation ダウンロード&インストール手順

#Xcode 6.1 Documentation ダウンロード&インストール手順

追記:feed は修正されているので正しくダウンロードできると思われます。上手く行かない場合 ~/Library/Caches/com.apple.dt.Xcode を削除すればよろしいかと。


こういう問題があり、正しくダウンロードできない。(feed が正しい URL を指しておらず OS X 10.10 Documentation がインストールされる)
http://stackoverflow.com/questions/26531103/xcode-6-1-not-download-the-documentation-files

手動で正しいものをダウンロード

@hetima
hetima / gist:f526cac58a2cdfce56fe
Last active August 29, 2015 14:10
WoTBlitz 課金関連

#WoTBlitz 課金関連

##ゴールド

  • 1,400G 500円 (0.357 円/G)(2.8 G/円)
  • 2,900G 1000円 (0.345 円/G)(2.9 G/円)
  • 6,075G 2000円 (0.329 円/G)(3.04 G/円)
  • 16,000G 5000円 (0.312 円/G)(3.2 G/円)
  • 34,000G 9800円 (0.288 円/G)(3.47 G/円)

##パッケージ

@hetima
hetima / gist:c145eabb6c55a3c8c8d9
Created December 28, 2014 05:32
pkg を解凍するスクリプト。新旧対応、ついでに rar も
#!/usr/bin/env ruby
require "tmpdir"
def proccess_rar(file)
param=["x", file]
system(["unrar", "unrar"], *param)
end
@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