Skip to content

Instantly share code, notes, and snippets.

View gothedistance's full-sized avatar
Let's go swallows

YUMOTO Michitaka gothedistance

Let's go swallows
View GitHub Profile
@gothedistance
gothedistance / api.py
Last active August 29, 2015 14:12 — forked from alanhamlett/api.py
import uuid
import wtforms_json
from sqlalchemy import not_
from sqlalchemy.dialects.postgresql import UUID
from wtforms import Form
from wtforms.fields import FormField, FieldList
from wtforms.validators import Length
from flask import current_app as app
from flask import request, json, jsonify, abort
UPDATE movie_log
INNER JOIN (
SELECT
item_id,
date,
view +
(
comment *
(
@gothedistance
gothedistance / mysql2sqlite.sh
Last active December 14, 2015 16:28 — forked from esperlu/mysql2sqlite.sh
Mysql Comment not support in sqlite3. added erase comments on line 75.
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite