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/bash | |
################################################################################ | |
# | |
# Copyright (c) 2008-2009 Christopher J. Stawarz | |
# | |
# Permission is hereby granted, free of charge, to any person | |
# obtaining a copy of this software and associated documentation files | |
# (the "Software"), to deal in the Software without restriction, | |
# including without limitation the rights to use, copy, modify, merge, |
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
- (NSString *)viewFrame1 { | |
return objc_getAssociatedObject(self, kUIViewAdditionsFrame1); | |
} | |
- (void)setViewFrame1:(NSString *)frameStr { | |
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
self.internetReachability = [Reachability reachabilityForInternetConnection]; | |
[self.internetReachability startNotifier]; | |
self.wifiReachability = [Reachability reachabilityForLocalWiFi]; | |
[self.wifiReachability startNotifier]; | |
[AppInfo setCurrentNetworkStatus:[self statusByWifiAndInternetReachability]]; | |
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
'<div>', | |
'<img src="' + ((retina && item.icon2x) ? item.icon2x : item.icon) + '" />', | |
'<h3>' + item.name + " " + item.version + '</h3>', | |
'<p>' + item.created_at + '</p>', | |
'<a href="itms-services://?action=download-manifest&url=' + item.install_plist_url + '">下载App</a> ', | |
'<a href="' + item.provisioning + '">下载证书</a>', | |
'</div>' | |
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
git clean -df | |
set -x | |
# do not exit immediately on non-zero return values | |
set +e | |
set -o verbose | |
export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer/ | |
XCODEBUILD_PATH=/Applications/Xcode.app/Contents/Developer/usr/bin | |
XCODEBUILD=$XCODEBUILD_PATH/xcodebuild |
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
View diversed commits between branches : git log --left-right --graph --cherry-pick --oneline devel...next |
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
1) nc & curl to view http request | |
$ nc -l localhost 8000 & | |
$ curl --proxy localhost:8000 --silent --max-time 1 http://baidu.com |
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
#import <CoreFoundation/CoreFoundation.h> | |
#import <Foundation/Foundation.h> | |
NSString *NSStringFromOSStatus(OSStatus errCode) | |
{ | |
if (errCode == noErr) | |
return @"noErr"; | |
char message[5] = {0}; | |
*(UInt32*) message = CFSwapInt32HostToBig(errCode); | |
return [NSString stringWithCString:message encoding:NSASCIIStringEncoding]; |
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
@interface TopBarViewController () | |
@property (nonatomic, strong) UIView *statusbarBgView; | |
@end | |
@implementation TopBarViewController | |
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
// Do any additional setup after loading the view. |
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
# -*- coding: utf-8 -*- | |
import sublime, sublime_plugin | |
import json | |
class JsonpropCommand(sublime_plugin.TextCommand): | |
""" | |
Test 1: | |
{"a" : "abc", "b" : 1} | |
Test 2: |
OlderNewer