Usage:
sqlite3 <sqlite3_filename> .dump | sqlite3-to-mysql.py | mysql <params>
or
sqlite3 <sqlite3_filename> .sch | sqlite3-to-mysql.py | mysql <params>
import operator | |
from django.db.models import Q | |
from selectable.base import LookupBase, ModelLookup | |
# if term is 'foo - bar', the middle '-' is ignored | |
SEARCH_IGNORED = (',', '.', '-', '/', ';', ':', '=', '\\',) | |
def split_terms(get_query): | |
""" This decorator breaks a single string received in the request by a | |
list of strings. |
from django.template import loader, loader_tags | |
def get_template_block(template_name, block_name): | |
"""Searchs a returns a single block inside a template. | |
Useful for ajax reloading inside a template. | |
- template_name can be a filename or a list of filenames. | |
- block_name is the name of the block to look for: | |
{% block block_name %} | |
This function returns a BlockNode instance, which can be rendered to |
# coding: utf-8 | |
__author__ = "Augusto Men" | |
__version__ = "$Revision: 0.1 $" | |
__date__ = "$Date: 2014/09/29 $" | |
DESCRIPTION = """Builds a tree of template files based on inheritance.""" | |
import os | |
import re |
Usage:
sqlite3 <sqlite3_filename> .dump | sqlite3-to-mysql.py | mysql <params>
or
sqlite3 <sqlite3_filename> .sch | sqlite3-to-mysql.py | mysql <params>
import random | |
consonants = 'bcdfghjlmnpqrstvxz' | |
vowels = 'aeiou' | |
def new_word(syllables=None): | |
if syllables is None: | |
syllables = random.randint(2, 5) | |
result = '' | |
for i in range(syllables): |
#! /usr/bin/env python | |
import sys | |
def main(): | |
sys.stdout.write("SET sql_mode='NO_BACKSLASH_ESCAPES';\n") | |
lines = sys.stdin.read().splitlines() | |
for line in lines: | |
sys.stdout.write(process_line(line)) | |
sys.stdout.write('\n') |
#!/usr/bin/python | |
import re | |
import sys | |
from datetime import datetime, timedelta | |
pattern = re.compile(r'<text start="([\d\.]+)" dur="([\d\.]+)">(.*?)</text>') | |
with open(sys.argv[1]) as fin: | |
content = fin.read().decode('utf-8') | |
dini = datetime(2010, 1, 1) |
# -*- coding: utf-8 -*- | |
import re | |
import sys | |
NEWLINE = '\r\n' | |
TIME_STR = re.compile(r'\d{2}\:\d{2}\:\d{2}[\,\.]\d{0,3}\s*--\>\s*\d{2}\:\d{2}\:\d{2}[\,\.]\d{0,3}') | |
TAGS_PATTERN = re.compile(r'\<[^\>]*\>') | |
def loadVersionCode() { | |
def code = 1 | |
new ByteArrayOutputStream().withStream { os -> | |
exec { | |
commandLine 'git', 'rev-list', 'HEAD', '--count' | |
standardOutput = os | |
} | |
code = os.toString().toInteger() | |
} | |
println "Version Code: $code" |
{% load bootstrapped_goodies_tags %} | |
<fieldset class="_module _aligned" id="fieldset-{% if stacked_prefix %}{{ stacked_prefix }}-{% endif %}{{ forloop.counter }}" style="background:transparent"> | |
{% if fieldset.name %} | |
<legend> | |
{% if 'collapse' in fieldset.classes %} | |
<a data-toggle="collapse" data-target="#fieldset-{% if stacked_prefix %}{{ stacked_prefix }}-{% endif %}{{ forloop.counter }} .fields"> | |
{{ fieldset.name }} | |
<span class="btn btn-xs btn-default"><span class="glyphicon glyphglyphicon glyphicon-resize-full"></i></span> | |
</a> | |
{% else %} |