<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>
-
URL
<The URL Structure (path only, no root url)>
-
Method:
from fabric.api import env, run, local | |
from fabric.decorators import hosts, with_settings | |
from fabric.context_managers import cd,lcd | |
import OS | |
env.use_ssh_config = True | |
def create_new_job(jobname): |
import os | |
import time | |
import MySQLdb | |
import psycopg2 | |
import _mysql_exceptions | |
from wsgi import * | |
def create_dbs(): | |
''' |
#encoding=utf8 | |
import sublime, sublime_plugin | |
import os, base64 | |
class Image2Base64(sublime_plugin.EventListener): | |
def on_load(self, view): | |
if view.file_name(): | |
fileName, fileExtension = os.path.splitext(view.file_name()) | |
if fileExtension.lower() in conv_extensions: |
class PubSub(object): | |
""" | |
Very simple Pub/Sub pattern wrapper | |
using simplified Redis Pub/Sub functionality. | |
Usage (publisher):: | |
import redis | |
r = redis.Redis() |
# Emulate pbcopy and pbpaste for copying to and from the pasteboard/clipboard | |
# | |
# via: http://whereswalden.com/2009/10/23/pbcopy-and-pbpaste-for-linux/ | |
alias pbcopy='xsel --clipboard --input' | |
alias pbpaste='xsel --clipboard --output' |
// Does {placeholder} substitution on a string. | |
// The object passed as the second parameter provides values to replace the {placeholder}s. | |
// | |
// usage: | |
// jQuery.substitute('{foo}', {foo:'123'}); | |
jQuery.substitute = function(str, sub) { | |
return str.replace(/\{(.+?)\}/g, function($0, $1) { | |
return $1 in sub ? sub[$1] : $0; | |
}); |
// Get document height (cross-browser) | |
// | |
// This function will return any document’s height. It’s been tested in IE6/7, | |
// FF2/3, Safari (Windows), Google Chrome and Opera 9.5. If the actual document’s | |
// body height is less than the viewport height then it will return the viewport | |
// height instead. | |
// | |
// @return {number} | |
function getDocHeight() { | |
var D = document; |
function string2Bin(str) { | |
var result = []; | |
for (var i = 0; i < str.length; i++) { | |
result.push(str.charCodeAt(i).toString(2)); | |
} | |
return result; | |
} |
function bin2String(str) { | |
var regex = /\d{8}/g, | |
arr = str.match(regex), | |
result = "", | |
len = arr.length; | |
for (var i = 0; i < len; i++) { | |
result += String.fromCharCode(parseInt(array[i], 2)); | |
} | |
return result; |