Skip to content

Instantly share code, notes, and snippets.

Carl Smith carlsmith

Block or report user

Report or block carlsmith

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
carlsmith /
Last active Aug 29, 2015
Launch one SL4A script from inside another one.
from android import Android
droid = Android()
def launch_script(path, visible=False):
visibilty = 'FORE' if visible else 'BACK'
activity = 'com.googlecode.android_scripting.action.LAUNCH_{0}GROUND_SCRIPT'.format(visibilty)
extras = {'com.googlecode.android_scripting.extra.SCRIPT_PATH': path}
package = 'com.googlecode.android_scripting'
classname = 'com.googlecode.android_scripting.activity.ScriptingLayerServiceLauncher'
carlsmith /
Last active Mar 27, 2018
Interleaved 2 of 5, SVG Barcode Generator
def render(digits):
'''This function converts its input, a string of decimal digits, into a
barcode, using the interleaved 2 of 5 format. The input string must not
contain an odd number of digits. The output is an SVG string.
Wikipedia [ITF Format]:
top = '<svg height="58" width="{0}" style="background:white">'
You can’t perform that action at this time.