Skip to content

Instantly share code, notes, and snippets.

View cppforlife's full-sized avatar
👉
building Kubernetes tools in https://github.com/k14s

Dmitriy Kalinin cppforlife

👉
building Kubernetes tools in https://github.com/k14s
View GitHub Profile
@cppforlife
cppforlife / links
Created September 23, 2011 06:17
Useful links
@cppforlife
cppforlife / gist:1175046
Created August 27, 2011 05:52
Reset NSNotificationCenter
// Useful in specs for debugging ran away NSNotifications.
// This code should not be used in production!
// NSNotificationCenter source: http://svn.opengroupware.org/SOPE/releases/4.4rc.1-rock/libFoundation/Foundation/NSNotificationCenter.m
static NSNotificationCenter *otherDefaultCenter;
@interface NSNotificationCenter (Reset)
+ (void)reset;
@cppforlife
cppforlife / gist:1175040
Created August 27, 2011 05:47
Comparing UIImages
@interface UIImage (ToEqualByBytes)
- (BOOL)toEqualByBytes:(UIImage *)otherImage;
@end
@implementation UIImage (ToEqualByBytes)
- (BOOL)toEqualByBytes:(UIImage *)otherImage {
@cppforlife
cppforlife / gist:1018032
Created June 10, 2011 00:07
query trace
alias disable_query_trace='cd ~/workspace/project/vendor/plugins/ ; rm -rf query_trace ; cd ~/workspace/project'
alias enable_query_trace='cd ~/workspace/project/vendor/plugins/ ; git clone http://github.com/ntalbott/query_trace.git ; cd ~/workspace/project'
COLOR_RED="\[\e[31;40m\]"
COLOR_GREEN="\[\e[32;40m\]"
COLOR_CYAN="\[\e[36;40m\]"
COLOR_RESET="\[\e[0m\]"
function git_branch_name {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo " ("${ref#refs/heads/}")"
# possible to use __git_ps1 here
}