Skip to content

Instantly share code, notes, and snippets.

View hankbao's full-sized avatar
🧠
use it or lose it

Hank Bao hankbao

🧠
use it or lose it
View GitHub Profile
//
// main.m
// antidebugging
//
// Created by Vincent Tan on 7/8/15.
// Copyright (c) 2015 Vincent Tan. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
@hankbao
hankbao / HopperVCppDemangler.py
Created September 3, 2017 16:23 — forked from thomasfinch/HopperVCppDemangler.py
A super crappy and kinda slow (it makes network calls!) Visual C++ demangler script for Hopper disassembler. Based on https://github.com/melomac/Hopper/blob/master/Demangle%20Swift.py, uses demangler.com
import urllib, urllib2
def demangle(symbol):
r = urllib2.Request('http://demangler.com/raw', urllib.urlencode({'input': symbol}))
response = urllib2.urlopen(r)
return response.read()
def main():
doc = Document.getCurrentDocument()
current = doc.getCurrentAddress()
cmake_minimum_required(VERSION 3.2.2)
function(PARSE_CMAKEJS_PROPERTIES)
function(GET_VARIABLE INPUT_STRING VARIABLE_TO_SELECT OUTPUT_VARIABLE)
set(SEARCH_STRING "${VARIABLE_TO_SELECT}=\"")
string(LENGTH "${SEARCH_STRING}" SEARCH_STRING_LENGTH)
string(LENGTH "${INPUT_STRING}" INPUT_STRING_LENGTH)
string(FIND "${INPUT_STRING}" "${VARIABLE_TO_SELECT}=\"" SEARCH_STRING_INDEX)
@hankbao
hankbao / sideproject_marketing_checklist.md
Created August 14, 2017 05:33
The Side Project Marketing Checklist
layout title permalink
checklist_page
The Side Project Marketing Checklist
/marketing-checklist/

Pre-Launch

Market Research

@hankbao
hankbao / aac_hardware_decoder_detect.m
Last active February 1, 2023 09:10
Using AudioFormat to check the availability of the AAC hardware encoder.
// Check this: https://developer.apple.com/library/content/qa/qa1663/_index.html
Boolean IsAACHardwareEncoderAvailable(void)
{
Boolean isAvailable = false;
OSStatus error;
// get an array of AudioClassDescriptions for all installed encoders for the given format
// the specifier is the format that we are interested in - this is 'aac ' in our case
UInt32 encoderSpecifier = kAudioFormatMPEG4AAC;
UInt32 size;
@hankbao
hankbao / Breakpoints_v2.xcbkptlist
Created July 14, 2017 02:40 — forked from Ashton-W/Breakpoints_v2.xcbkptlist
My User Breakpoints_v2.xcbkptlist
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "2"
version = "2.0">
<Breakpoints>
<!-- All Exceptions -->
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint">
<BreakpointContent
@hankbao
hankbao / sudoku.hs
Created October 30, 2015 19:37 — forked from kristopherjohnson/sudoku.hs
Sudoku solver in Haskell
#!/usr/bin/env runhaskell
-- Note: For a slight improvement in performance, import the non-portable
-- Data.Array.Unboxed module instead of Data.Array, and change the Board
-- type below to use "UArray" instead of "Array".
import Data.Array
-- Solve the example puzzle specified below
-- TODO: read puzzle from input
main = do
@hankbao
hankbao / Fuckgfw.conf
Created October 12, 2015 13:47 — forked from jason5ng32/surge.conf
Surge Config
[General]
loglevel = notify
bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12,127.0.0.0/24
[Proxy]
// ADD YOUR PROXY HERE, DON'T FORGET TO REMOVE #
# Proxy = http,$IP,$PORT,$USERNAME,$PASSWORD
# Proxy = https,$IP,$PORT,$USERNAME,$PASSWORD
@hankbao
hankbao / UIDeivce+Processes.m
Created September 18, 2015 14:04
UIDevice Category For Processes
// .h
@interface UIDevice (ProcessesAdditions)
- (NSArray *)runningProcesses;
@end
// .m
#import <sys/sysctl.h>
@implementation UIDevice (ProcessesAdditions)
@hankbao
hankbao / GCDMulticastDelegate.h
Created May 31, 2015 07:38
GCDMulticastDelegate
#import <Foundation/Foundation.h>
@class GCDMulticastDelegateEnumerator;
/**
* This class provides multicast delegate functionality. That is:
* - it provides a means for managing a list of delegates
* - any method invocations to an instance of this class are automatically forwarded to all delegates
*
* For example: