zingo


Member since 06/17/2007

zingo

Location: Berlin/Germany

43 snippets

6652 profile views

4 Comment(s) Posted

View their favorites

Profile

Achievement

first submission:submitting first snipplet popular snippet:having a snipplet with 20 favorites

zingo's Recent Snippets



« Prev 1 2
Cocoa provides NSTask to run subprocesses. It can be used to run shell scripts, but all this manual pipe and file handling is a bit cumbersome. Fortunately, for a simple script, we can use the trusty old system and redirect its result to a file.
0 780 posted 12 years ago by zingo
Do you need you app to do something when it is first run on a certain computer? Do you need to know if it has been run before? Enter the following code into your Application Delegate. This code creates a BOOL that is created when the app is run. T...
0 827 posted 12 years ago by zingo
Get a list of providers for DTrace that OSX supports. (DTrace is a probe/profiling tool created by Sun that came with Mac OS X starting with Leopard.)
0 760 posted 12 years ago by zingo
Drawing scaled rectangles of arbitrary width and height that keeps the corner and sides properly scaled while growing the center.
1 802 posted 13 years ago by zingo
List of breakpoints for debuging with gdb. Add them to your ~/.gdbinit.
0 738 posted 13 years ago by zingo
grep through all history from within a Subversion working directory, like: $ svngrep SecItemCopyMatching *
0 681 posted 13 years ago by zingo
With 10.5 Apple deprecated the use of NSMailDelivery – without a replacement. So the questions comes up regulary – how does one send emails from Cocoa? Turns out there are couple of frameworks available that can also be used to do the job. *...
0 968 posted 14 years ago by zingo
Using SQL you can have your database return the distance between 2 sets of Lat and Long points, and using some math functions also take into account the curvature of the earth.
3 948 posted 14 years ago by zingo
Put this into your ~/.bashrc script and you should see the Git/SVN status in your prompt if your working directory is a sandbox.
0 823 posted 14 years ago by zingo
Show table size, number of rows, and size of indexes in MySQL.
1 927 posted 15 years ago by zingo
Substitute and update keywords like $HeadURL$, $Revision$, etc. in a file on every commit to subversion repos. 1. Set svn:keywords on repos: $ svn propset --recursive svn:keywords 'HeadURL Revision LastChangedBy Date' /path/to/repo 2. Use this...
0 743 posted 15 years ago by zingo
Remove all the keys of the application’s preferences file from ~/Library/Preferences with Cocoa’s NSUserDefaults class.
2 725 posted 15 years ago by zingo
Place this in your ~/.bash_profile then type tab in your terminal window to see some magic happen.
0 637 posted 15 years ago by zingo
Using a gcc predefined macro, __DATE__, the code can know for itself when it was compiled, and build in an expiration date based on that value. The former code (http://snipplr.com/view/3448/kill-app-after-expire-date/) was not internationalised an...
5 851 posted 15 years ago by zingo
0 670 posted 15 years ago by zingo
Recursively SVN rename (move) all thtml-files to ctp-files . Fires this up in CakePHPs /views path.
0 812 posted 15 years ago by zingo
This can be used to test FS type.
1 744 posted 15 years ago by zingo
You can store an IP address in an INT UNSIGNED (4 bytes) which is of course much more efficient and faster than a CHAR(15). MySQL has two built-in functions: INET_ATON() and INET_NTOA(). These two functions are used allover the place in any TCP/IP s...
0 847 posted 15 years ago by zingo
30 4095 posted 15 years ago by zingo
recover to normal speed with /sbin/ipfw delete 100 /sbin/ipfw delete 200 ... or reboot
0 736 posted 16 years ago by zingo
0 806 posted 16 years ago by zingo
0 730 posted 16 years ago by zingo
0 702 posted 16 years ago by zingo
2 713 posted 16 years ago by zingo
1 772 posted 16 years ago by zingo
Macro to give an asl_log-like NSLog.
2 895 posted 16 years ago by zingo
« Prev 1 2