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 python | |
class Meta(type): | |
def __new__(self, name, bases, attrs): | |
print('Meta: __new__: {} | {} | {} | {}'.format(self, name, bases, attrs)) | |
return super(Meta, self).__new__(self, name, bases, attrs) | |
def __init__(cls, name, bases, attrs): | |
print('Meta: __init__: {} | {} | {} | {}'.format(cls, name, bases, attrs)) | |
super(Meta, cls).__init__(name, bases, attrs) |
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 python | |
#-*- coding: utf-8 -*- | |
import json | |
import os | |
from datetime import datetime | |
from dateutil import parser, tz | |
def dump_json(obj): | |
return json.dumps(obj, indent=4, |
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
"slack.com", | |
"slack-imgs.com", | |
"slack-edge.com", | |
"slack-msgs.com", | |
"api.mixpanel.com", | |
"global.ssl.fastly.net", | |
"amazonaws.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
#!/bin/bash | |
find ./ -name "*.a" | xargs nm -gU | sed -n -e 's/.*_OBJC_CLASS_$_\(.*\)/\1/p' |
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 Darwin | |
let handle = dlopen("/usr/lib/libc.dylib", RTLD_NOW) | |
let sym = dlsym(handle, "random") | |
let functionPointer = UnsafeMutablePointer<() -> CLong>(sym) | |
let result = functionPointer.memory() | |
println(result) |
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 *)executableUUID { | |
const struct mach_header *executableHeader = NULL; | |
for (uint32_t i = 0; i < _dyld_image_count(); i++) { | |
const struct mach_header *header = _dyld_get_image_header(i); | |
if (header->filetype == MH_EXECUTE) { | |
executableHeader = header; | |
break; | |
} | |
} | |
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 python | |
#-*- coding: utf-8 -*- | |
import re | |
from distutils.version import LooseVersion | |
_POD_RE = re.compile(r'\s{1,1}- (.*) \((.*)\)') | |
def parse_lock_file(lock): | |
pods = {} |
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 | |
# Add this script to your Scheme->Build->Post Actions | |
ASSETS_PATH=${CODESIGNING_FOLDER_PATH}/Assets.car | |
xcrun --sdk ${PLATFORM_NAME} assetutil --info ${ASSETS_PATH} | grep -q "DisplayGamut.*P3" | |
if [ $? -eq 0 ]; then | |
osascript -e 'tell app "System Events" to display dialog "Some images are in Display P3 gamut, which is not supported in iOS 9.0~9.2"' | |
# xcrun --sdk ${PLATFORM_NAME} assetutil --info ${ASSETS_PATH} > /tmp/assets.json |
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 |
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 |