This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install -g electron --unsafe-perm=true --allow-root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!flask/bin/python | |
from migrate.versioning import api | |
from config import SQLALCHEMY_DATABASE_URI | |
from config import SQLALCHEMY_MIGRATE_REPO | |
from app import db | |
import os.path | |
db.create_all() | |
if not os.path.exists(SQLALCHEMY_MIGRATE_REPO): | |
api.create(SQLALCHEMY_MIGRATE_REPO, 'database repository') | |
api.version_control(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!flask/bin/python | |
import imp | |
from migrate.versioning import api | |
from app import db | |
from config import SQLALCHEMY_DATABASE_URI | |
from config import SQLALCHEMY_MIGRATE_REPO | |
v = api.db_version(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO) | |
migration = SQLALCHEMY_MIGRATE_REPO + ('/versions/%03d_migration.py' % (v+1)) | |
tmp_module = imp.new_module('old_model') | |
old_model = api.create_model(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!flask/bin/python | |
from migrate.versioning import api | |
from config import SQLALCHEMY_DATABASE_URI | |
from config import SQLALCHEMY_MIGRATE_REPO | |
v = api.db_version(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO) | |
api.downgrade(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO, v - 1) | |
v = api.db_version(SQLALCHEMY_DATABASE_URI, SQLALCHEMY_MIGRATE_REPO) | |
print('Current database version: ' + str(v)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const timeTaken = (func,...args) => { | |
var t0 = performance.now(), r = func(...args); | |
console.log(performance.now() - t0); | |
return r; | |
} | |
// timeTaken(Math.pow, 2, 10) -> 1024 (0.010000000009313226 logged in console) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install git+ssh://git@github.com/your-company/react-scripts-fork |
https://jsfiddle.net/esyvws3d/60/ - input[range]
https://codepen.io/nashvail/pen/wpGgXO - Background random balls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Find ip - cat /var/lib/misc/dnsmasq.leases |
Github: @anshumanv
Organisation: FOSSASIA
Project: SUSI Analytics
Adding analytics and skill metrics to SUSI.
OlderNewer