Skip to content

Instantly share code, notes, and snippets.

View srittau's full-sized avatar

Sebastian Rittau srittau

View GitHub Profile
@srittau
srittau / sqlparse_delimiters.py
Last active April 18, 2024 08:04
sqlparse with delimiter support
# Split SQL file using sqlparse with delimiter handling.
#
# The SQL string is pre-processed before handing it off to sqlparse.split:
# DELIMITER statements are removed, semicolons within non-standard
# delimiter blocks are replaced by the Unicode Object Replacement
# Character, and custom delimiters replaced with semicolons. After
# processing the string with sqlparse.split, the Object Replacement Characters
# are replaced with semicolons again.
import re
@srittau
srittau / include.js
Created November 1, 2017 20:43
Loading Modules in JavaScript v2
// $Revision: 5816 $
var include;
if (!include) { include = {}; }
include.base = ".";
include.ModuleLoader = function ModuleLoader() {
this.loadingModules = {};
this.loadedModules = {};
@srittau
srittau / include.js
Created November 1, 2017 20:41
Loading Modules in JavaScript v1
// $Revision: 5805 $
var include;
if (!include) { include = {}; }
include.ModuleLoader = function ModuleLoader() {
this.loadingModules = {};
this.loadedModules = {};
};
@srittau
srittau / keyring.py
Created November 1, 2017 20:35
gnome-keyring Python example
__version__ = "$Revision: 14294 $"
import gtk # ensure that the application name is correctly set
import gnomekeyring as gkey
class Keyring(object):
def __init__(self, name, server, protocol):
self._name = name
self._server = server