Skip to content

Instantly share code, notes, and snippets.

View wgwz's full-sized avatar
🌱

Kyle Lawlor-Bagcal wgwz

🌱
View GitHub Profile
@wgwz
wgwz / index.js
Created February 2, 2019 18:51 — forked from loic-moriame/index.js
node.js + sequelize + sqlite
'use strict';
var Sequelize = require('sequelize');
var sequelize = new Sequelize('mainDB', null, null, {
dialect: "sqlite",
storage: './test.sqlite',
});
sequelize
@wgwz
wgwz / gist:cb5c3560143bdc6aa5053c17917d0184
Created December 31, 2018 02:40 — forked from danielestevez/gist:2044589
GIT Commit to an existing Tag
1) Create a branch with the tag
git branch {tagname}-branch {tagname}
git checkout {tagname}-branch
2) Include the fix manually if it's just a change ....
git add .
git ci -m "Fix included"
or cherry-pick the commit, whatever is easier
git cherry-pick {num_commit}
@wgwz
wgwz / gist:384cb106dd56fe6b8da07a3769b523c6
Created December 2, 2018 04:48 — forked from jasonkarns/readme.md
Git send-email using Gmail
  1. Configure Gmail in you gitconfig:
[sendemail]
  smtpserver = smtp.gmail.com
  smtpserverport = 587
  smtpencryption = tls
  smtpuser = <gmail email address>
  from = <email address for From: field>
@wgwz
wgwz / flask_cors.py
Created April 12, 2017 01:07 — forked from blixt/flask_cors.py
How to add CORS support to a Flask app in 9 lines of code
def add_cors_headers(response):
response.headers['Access-Control-Allow-Origin'] = '*'
if request.method == 'OPTIONS':
response.headers['Access-Control-Allow-Methods'] = 'DELETE, GET, POST, PUT'
headers = request.headers.get('Access-Control-Request-Headers')
if headers:
response.headers['Access-Control-Allow-Headers'] = headers
return response
app.after_request(add_cors_headers)
@wgwz
wgwz / issue.py
Created July 22, 2016 22:54 — forked from CorneliaXaos/issue.py
Demonstrates a Possible Issue with the Flask Test Client
from flask import Flask, Blueprint
app = Flask(__name__)
bp = Blueprint("test", __name__)
@bp.route("/test/")
def test():
return "TEST"
app.register_blueprint(bp, subdomain="test")
@wgwz
wgwz / form_test.py
Created June 16, 2016 21:21 — forked from anddam/form_test.py
Pagination issue while using Flask-WTF in Flask with Flask-Bootstrap and Flask-SQLAlchemy
from flask import Flask, render_template_string, request
from flask_bootstrap import Bootstrap
from jinja2 import Template
from flask_wtf import Form
from wtforms import StringField
from wtforms.validators import DataRequired
from flask_sqlalchemy import SQLAlchemy
# Build the app along with its extensions and the route
@wgwz
wgwz / tmux-cheatsheet.markdown
Created March 12, 2016 19:02 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@wgwz
wgwz / wtf.txt
Created January 22, 2016 15:34 — forked from doobeh/wtf.txt
Persuading WTForms to Generate Checkboxes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
WTForms takes the pain out of handling forms and validation, you define your form,
tell it what validation checks the data needs to pass, then WTForms uses it's
widgets to generate the html.
A common problem you'll face is "Multiple select fields suck, they are confusing--
how can I show the user a nice list of checkboxes instead?"