zingo


Member since 06/17/2007

zingo

Location: Berlin/Germany

43 snippets

24 profile views

4 Comment(s) Posted

View their favorites

Profile

All time reputation: 222

Achievement

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

zingo's Recent Snippets



« Prev 1 2
  1. FAV

    Quickest Way to Shell - Use system() instead of NSTask

    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.
    Objective C 7 views posted 8 years ago zingo
  2. FAV

    Checking If You App Has Been Run Before

    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...
    Objective C 5 views posted 8 years ago zingo
  3. FAV

    Get a list of unique dtrace providers

    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.)
    Bash 5 views posted 8 years ago zingo
  4. FAV

    Drawing Scaled Rectangles with NSDrawNinePartImage

    Drawing scaled rectangles of arbitrary width and height that keeps the corner and sides properly scaled while growing the center.
    Objective C saved by 1 person 5 views posted 9 years ago zingo
  5. FAV

    List of Breakpoints for gdb

    List of breakpoints for debuging with gdb. Add them to your ~/.gdbinit.
    Other 7 views posted 9 years ago zingo
  6. FAV

    Searching through Subversion history

    grep through all history from within a Subversion working directory, like: $ svngrep SecItemCopyMatching *
    Bash 4 views posted 9 years ago zingo
  7. FAV

    Sending emails from Cocoa

    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. *...
    Objective C 9 views posted 10 years ago zingo
  8. FAV

    Calculating distance in Kilometres and Miles from Latitude and Longitude

    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.
    SQL saved by 27 people 8 views posted 10 years ago zingo
  9. FAV

    Git and SVN Status in the Bash Prompt

    Put this into your ~/.bashrc script and you should see the Git/SVN status in your prompt if your working directory is a sandbox.
    Bash 5 views posted 10 years ago zingo
  10. FAV

    MySQL table size, number of rows, and size of indexes

    Show table size, number of rows, and size of indexes in MySQL.
    MySQL saved by 4 people 11 views posted 10 years ago zingo
  11. FAV

    Parse Header File for Outlets and makes sure that they are set at Runtime

    Objective C 4 views posted 11 years ago zingo
  12. FAV

    Template for DocBlock and svn:keywords

    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...
    SVN 7 views posted 11 years ago zingo
  13. FAV

    Removing preferences belonging to your app

    Remove all the keys of the application’s preferences file from ~/Library/Preferences with Cocoa’s NSUserDefaults class.
    Objective C saved by 2 people 2 views posted 11 years ago zingo
  14. FAV

    Quick new tab from iTerm

    Place this in your ~/.bash_profile then type tab in your terminal window to see some magic happen.
    Bash 4 views posted 11 years ago zingo
  15. FAV

    Kill App after Expire Date (Suicidal Code Redux)

    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...
    Objective C saved by 5 people 19 views posted 11 years ago zingo
  16. FAV

    Words with many doubled letters

    Bash 3 views posted 11 years ago zingo
  17. FAV

    Using the svn revision number in cakePHP application

    PHP saved by 4 people 6 views posted 11 years ago zingo
  18. FAV

    SVN rename all your CakePHP views from thtml to ctp

    Recursively SVN rename (move) all thtml-files to ctp-files . Fires this up in CakePHPs /views path.
    Bash 5 views posted 11 years ago zingo
  19. FAV

    Filesystem - Testing FS Type

    This can be used to test FS type.
    Objective C saved by 4 people 4 views posted 11 years ago zingo
  20. FAV

    Storing an IP address in a database table

    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...
    SQL 5 views posted 11 years ago zingo
  21. FAV

    8 Premium One Line Css Tips

    CSS saved by 120 people 90 views posted 11 years ago zingo
  22. FAV

    Emulating a Slow Internet Link for HTTP

    recover to normal speed with /sbin/ipfw delete 100 /sbin/ipfw delete 200 ... or reboot
    Bash 6 views posted 11 years ago zingo
  23. FAV

    Testing Regular Expressions for NSString

    Objective C 14 views posted 12 years ago zingo
  24. FAV

    Saving Data to File

    Objective C 5 views posted 12 years ago zingo
  25. FAV

    Get Infos on WLAN on OSX

    Bash 6 views posted 12 years ago zingo
  26. FAV

    Get Infos on Battery on OSX

    Bash 5 views posted 12 years ago zingo
  27. FAV

    Get the Count of unread Messages in Vienna (RSS-Reader)

    AppleScript 5 views posted 12 years ago zingo
  28. FAV

    Get Temperature on OSX

    Bash saved by 2 people 7 views posted 12 years ago zingo
  29. FAV

    Differences between two Tables

    SQL saved by 4 people 9 views posted 12 years ago zingo
  30. FAV

    Macro for ASL Log like NSLog

    Macro to give an asl_log-like NSLog.
    Objective C saved by 2 people 5 views posted 12 years ago zingo
« Prev 1 2