Skip to content

Instantly share code, notes, and snippets.

@nbessi
nbessi / gist:993356
Created May 26, 2011 15:26
Nice Logger helper from Florent really useful
import netsvc
logger = netsvc.Logger()
class Logger(object):
"""Provide an API similar to the standard 'logging' module."""
__slots__ = ('name',)
def __init__(self, name):
Xcode 4 custom snippet
If you want to make your own custom snippets with in preview version of Xcode 4 and do not want to wait for the function to be implemented here is the way :
Open the folder ~/Library/Developer/Xcode/UserData/CodeSnippets
Create a file named my_nice_file.codesnippet (one file per snippet)
It should look like this : http://gist.github.com/521183
There is only one rule to respect :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDECodeSnippetCompletionPrefix</key>
<string></string>
<key>IDECodeSnippetContents</key>
<string>class &lt;#MyClass#&gt;(osv.osv):
" &lt;#DOCString#&gt;"
#_name="My name"