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/sh | |
# Remove an object from a static library. | |
LIB_SRC=${1} | |
OBJ=${2} | |
if [ -z ${OBJ} ]; then |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>PayloadContent</key> | |
<array> | |
<dict> | |
<key>IKEv2</key> | |
<dict> | |
<key>AuthName</key> |
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
#!/usr/bin/env python3 | |
import sys | |
import uuid | |
import time | |
import hashlib | |
import requests | |
YOUDAO_URL = 'https://openapi.youdao.com/api' | |
APP_KEY = '4eb54b2bc1173f2b' |
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
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
// init VPN manager | |
self.vpnManager = [NEVPNManager sharedManager]; | |
// load config from perference | |
[_vpnManager loadFromPreferencesWithCompletionHandler:^(NSError *error) { |
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
{ | |
"i386": "Simulator", | |
"x86_64": "Simulator", | |
"iPad1,1": "iPad", | |
"iPad2,1": "iPad 2", | |
"iPad2,2": "iPad 2", | |
"iPad2,3": "iPad 2", | |
"iPad2,4": "iPad 2", | |
"iPad3,1": "iPad (3rd generation)", | |
"iPad3,2": "iPad (3rd generation)", |
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 | |
# Usage: ./icon.sh icon.png | |
icon=$1 | |
icon_name=${icon%.*} | |
icon_dir=${icon}.iconset | |
icon_tmp_path=/tmp/${icon_dir} |
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 | |
ipa_name=$1 | |
plist_path=$(unzip -l "$ipa_name" | grep "Payload/[^/]*\/Info.plist" | sed 's/.*\(Payload.*Info.plist\)/\1/g') | |
#unzip | |
unzip -jo "$ipa_name" "$plist_path" >/dev/null | |
#convert to xml1 format | |
plutil -convert xml1 Info.plist |
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 GCDWebServer | |
class CorsProxy { | |
init(webserver : GCDWebServer!, urlPrefix: String) { | |
var prefix = | |
(urlPrefix.hasPrefix("/") ? "" : "/") | |
+ urlPrefix | |
+ (urlPrefix.hasSuffix("/") ? "" : "/") | |
let pattern = "^" + NSRegularExpression.escapedPatternForString(prefix) + ".*" |
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 | |
TARGET="/Volumes/sandbox.app" | |
APP_ID="app.bundle.id" | |
if [ -d $TARGET ]; then | |
sudo umount $TARGET | |
fi | |
sudo mkdir $TARGET |
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 | |
DERIVED_DATA=~/Library/Developer/Xcode/DerivedData | |
# Kill Xcode | |
echo "💥 Killing Xcode ..." | |
kill $(ps aux | grep 'Xcode' | awk '{print $2}') 2>/dev/null | |
# Remove xcuserdata | |
for f in `ls -t $DERIVED_DATA`; do |
NewerOlder