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
  • Vancouver, BC
  • 22:44 (UTC -07:00)
  • X @hankbao
View GitHub Profile
@textarcana
textarcana / .emacs
Created February 14, 2009 22:06
.emacs file for Aquamacs Emacs and GNU Emacs on OS X.
;;Noah Sussman's .emacs file for Aquamacs Emacs and GNU Emacs on OS X.
;;Branched February 16 2008 from my config for GNU Emacs for Windows, created Oct 18 2001.
;;Time-stamp: </Users/noah/Documents/n_s/config/emacs/aquamacs/.emacs last changed by Noah Sussman on noah.local/Textarcana Saturday 14 February 2009 at EST 16:51:25>
(load-file "~/.emacs-cfg/secrets.el")
;;;; Spaces are always used for indendation
;;;;;; Haml and Sass modes require this setting
(setq indent-tabs-mode nil)
@bkyle
bkyle / NSArray+Globbing.h
Created February 3, 2010 20:02
NSArray+Globbing
#import <Foundation/Foundation.h>
@interface NSArray (Globbing)
+ (NSArray*) arrayWithFilesMatchingPattern: (NSString*) pattern inDirectory: (NSString*) directory;
@end
// DySlim is complicated and requires writing 6GB to disk (if only temporarily).
// This lets you mount the dyld shared cache via FUSE; the resulting files are weird but readable by things like otool and strings.
//
// gcc -std=gnu99 -I/opt/local/include -L/opt/local/lib -D_FILE_OFFSET_BITS=64 -o dsc dsc.c -lfuse -framework CoreFoundation
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <stdio.h>
//
// PSDDFormatter.h
// Created by Peter Steinberger on 08.09.10.
//
#import "DDLog.h"
@interface PSDDFormatter : NSObject <DDLogFormatter> {
NSDateFormatter *dateFormatter;
}
@larsch
larsch / PrecompiledHeader.cmake
Last active March 12, 2022 10:49
cmake module for setting up precompiled headers (MSVC & GCC)
# Function for setting up precompiled headers. Usage:
#
# add_library/executable(target
# pchheader.c pchheader.cpp pchheader.h)
#
# add_precompiled_header(target pchheader.h
# [FORCEINCLUDE]
# [SOURCE_C pchheader.c]
# [SOURCE_CXX pchheader.cpp])
#
@sixman9
sixman9 / CMakeLists.txt
Created December 14, 2010 10:42
cmake files for Apple IOS development (has C++ lean, can be adapted however)
# See original post at http://stackoverflow.com/questions/822404/how-to-set-up-cmake-to-build-an-app-for-the-iphone
cmake_minimum_required(VERSION 2.8)
cmake_policy(SET CMP0015 NEW)
cmake_policy(SET CMP0016 NEW)
project(test)
set(NAME test)
@osteslag
osteslag / version.sh
Created July 18, 2011 12:45
Script for managing build and version numbers using git and agvtool. See link in comments below.
#!/bin/sh
# Script for managing build and version numbers using git and agvtool.
# Change log:
# v1.0 18-Jul-11 First public release.
# v1.1 29-Sep-12 Launch git, agvtool via xcrun.
version() {
@ddeville
ddeville / gist:1527517
Created December 28, 2011 10:40
MIME type to UTI and back again in Cocoa
#if TARGET_OS_IPHONE
#import <MobileCoreServices/MobileCoreServices.h>
#else
#import <CoreServices/CoreServices.h>
#endif
/*
MIME type to UTI
*/
NSURLResponse *response = ... // assume a URL response from somewhere else.
@qrush
qrush / Inconsolata-dz-Powerline.otf
Created January 11, 2012 16:50
vim-powerline patched fonts
@bringhurst
bringhurst / gist:1693075
Created January 28, 2012 06:42
How to create a tun in osx without installing 3rd party crap
#include <netinet/in.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/kern_control.h>
#include <sys/ioctl.h>
#include <sys/sys_domain.h>
#include <sys/kern_event.h>
#include <sys/errno.h>
#define UTUN_CONTROL_NAME "com.apple.net.utun_control"