This file contains hidden or 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
# workaround for bitcode generation problem with Xcode 7.3 | |
unset TOOLCHAINS | |
FRAMEWORK_NAME="YourFramework" | |
SIMULATOR_FRAMEWORK_PATH="${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${FRAMEWORK_NAME}.framework" | |
DEVICE_FRAMEWORK_PATH="${BUILD_DIR}/${CONFIGURATION}-iphoneos/${FRAMEWORK_NAME}.framework" | |
UNIVERSAL_BUILD_DIR="${BUILD_DIR}/${CONFIGURATION}-iphoneuniversal" | |
UNIVERSAL_FRAMEWORK_PATH="${UNIVERSAL_BUILD_DIR}/${FRAMEWORK_NAME}.framework" | |
This file contains hidden or 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
# Execute an executable under gdb, printing a call stack if we get a crash. | |
gdb -return-child-result -quiet -batch \ | |
-ex "set env MALLOC_CHECK_=3" \ | |
-ex "set print thread-events off" \ | |
-ex run \ | |
-ex "thread apply all backtrace full" \ | |
-ex "quit" \ | |
$* |
This file contains hidden or 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
# Execute an executable under gdb, printing a call stack if we get a crash. | |
gdb -return-child-result -quiet -batch \ | |
-ex "set env MALLOC_CHECK_=3" \ | |
-ex "set print thread-events off" \ | |
-ex run \ | |
-ex "thread apply all backtrace full" \ | |
-ex "quit" \ | |
$* |
This file contains hidden or 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 -*- | |
from __future__ import print_function | |
from functools import wraps | |
def extension(cls, verbose=False): | |
if not isinstance(cls, type): | |
raise ValueError("{} is not a class".format(cls)) | |
def func_deco(func): | |
if verbose and func.__name__ in globals(): |
This file contains hidden or 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 | |
from __future__ import print_function | |
from flask import Flask, url_for, redirect | |
import argparse | |
app = Flask(__name__) | |
# If you look at the source code of `Flask.route`, | |
# endpoint is just a key for Flask to route incoming | |
# request to view function (like `hello` function here). |
This file contains hidden or 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 | |
# -*- coding: utf-8 -*- | |
# http://docs.opencv.org/trunk/df/dfb/group__imgproc__object.html#ga586ebfb0a7fb604b35a23d85391329be | |
from __future__ import print_function | |
import argparse | |
import sys | |
try: | |
import cv2 | |
except ImportError: | |
print("Install opencv python binding first", file=sys.stderr) |
This file contains hidden or 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 -*- | |
from __future__ import print_function | |
class Foo(object): | |
def __new__(cls, *args, **kwargs): | |
print("Foo.__new__ invoked") | |
print("args:", args) | |
print("kwargs:", kwargs) | |
# in python3, you can just simply call super() here |
This file contains hidden or 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 | |
from __future__ import print_function | |
import sys | |
try: | |
import cv2 | |
import numpy as np | |
except ImportError: | |
print("install cv2 and numpy please.", file=sys.stderr) | |
sys.exit(1) |
This file contains hidden or 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 | |
# -*- coding: utf8 -*- | |
import sys, argparse | |
try: | |
import cv2 | |
import numpy as np | |
from scipy.ndimage import convolve | |
except ImportError: | |
print("install opencv and scipy please", file=sys.stderr) | |
sys.exit(1) |