Skip to content

Instantly share code, notes, and snippets.

View wachpwnski's full-sized avatar

John Wachowski wachpwnski

View GitHub Profile
@wachpwnski
wachpwnski / correct.py
Created April 9, 2015 07:50
apiDoc requires incorrect usage of docstring to global apiDefine
"""
@apiDefine admin User access only
This optional description belong to to the group admin.
@apiDefine owner User access only
This optional description belong to to the group owner.
"""
import foo
'use strict';
/* Singleton AutobahnJS Websocket Connection as AngularJS Service */
angular.module('AutobahnJSWebsocketService', [])
.factory('Websocket', ['$q', function($q) {
var openSession = null;
var isOpening = false;
var waitingList = [];
import re
def strip_margin(text):
return re.sub('\n[ \t]*\|', '\n', text)
def strip_heredoc(text):
indent = len(min(re.findall('\n[ \t]*(?=\S)', text) or ['']))
pattern = r'\n[ \t]{%d}' % (indent - 1)
return re.sub(pattern, '\n', text)