Skip to content

Instantly share code, notes, and snippets.

View ziggear's full-sized avatar
😀
Enjoy opensource

Ziggear ziggear

😀
Enjoy opensource
  • Some Company
  • Earth
View GitHub Profile
@ziggear
ziggear / gist:8002951
Created December 17, 2013 10:35
wp result
(
{
"comment_status" = open;
"custom_fields" = (
);
guid = "http://www.ziggear.us/?p=1";
link = "http://www.ziggear.us/?p=1";
"menu_order" = 0;
"ping_status" = open;
"post_author" = 1;
//LuaJIT on iOS 5.1
Lua SciMark 2010-12-10 based on SciMark 2.0a. Copyright (C) 2006-2010 Mike Pall.
FFT 4.76 [1024]
SOR 12.18 [100]
MC 2.94
SPARSE 7.84 [1000, 5000]
LU 10.60 [100]
SciMark 7.67 [small problem sizes]
NSDictionary *dict = ...
...
for (NSString *key in dict) {
NSString *value = [dict objectForKey:key];
...
}
plutil -p xml1 Info.plist | grep "BundleName" | sed 's/ "\(.*\)" => "\(.*\)"/\2/'
plutil -p xml1 Info.plist | grep "BundleShortVersionString" | sed 's/ "\(.*\)" => "\(.*\)"/\2/'
plutil -p xml1 Info.plist | grep "BundleDisplayName" | sed 's/ "\(.*\)" => "\(.*\)"/\2/'
plutil -p xml1 Info.plist | grep "BundleIdentifier" | sed 's/ "\(.*\)" => "\(.*\)"/\2/'
// Created by ziggear on 13-5-26
// fw & courtesy: http://cocoasamurai.blogspot.com/2011/04/singletons-your-doing-them-wrong.html
// usage:
// @implementation SomeClass
// ....
// kSingletonSynthesize(SomeClass)
// @end
//Thread-safe block
#define kRunInSecurutyBlock(lines) static dispatch_once_t pred; dispatch_once(&pred, ^{ \
#fw:http://www.macworld.com/article/1157370/applescriptsystempreferences.html
#AppleScript
#Filename: ToggleSharing.scpt
tell application "System Preferences"
activate
end tell
tell application "System Events"
tell process "System Preferences"
#fw:http://www.techiecorner.com/35/how-to-flush-dns-cache-in-linux-windows-mac/
#windows
ipconfig /flushdns
#linux
/etc/rc.d/init.d/nscd restart
#Mac OS X Leopard
lookupd -flushcache
#Google
#:faster one
8.8.8.8
8.8.4.4
#V2EX
#:boost appstore speed
199.91.73.222
178.79.131.110
#(1)引导后按tab, 在后面追加数字3 .
#(2)root登录执行命令
/usr/sbin/anaconda --liveinst --method=livecd:///dev/mapper/live-osimg-min
#(3) 修改默认启动到文本界面
cd /etc/systemd/system
ln -s /lib/systemd/system/multi-user.target default.target
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *oneCell = [tableView cellForRowAtIndexPath: indexPath];
if (oneCell.accessoryType == UITableViewCellAccessoryNone) {
oneCell.accessoryType = UITableViewCellAccessoryCheckmark;
} else
oneCell.accessoryType = UITableViewCellAccessoryNone;
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}