Skip to content

Instantly share code, notes, and snippets.

@app.route('/login/<provider_name>', methods=['GET', 'POST'])
@authomatic.login('g')
@requires_ssl
def login(provider_name):
if g.user is not None and g.user.is_authenticated():
return redirect(url_for('index'))
if authomatic.result:
if authomatic.result.error:
return 'Something went wrong: {0}'.format(authomatic.result.error.message)
if authomatic.result.user:
@jbolda
jbolda / keybase.md
Created April 2, 2015 03:43
keybase.md

Keybase proof

I hereby claim:

  • I am jbolda on github.
  • I am jbolda (https://keybase.io/jbolda) on keybase.
  • I have a public key whose fingerprint is 6EEE 24F0 D316 B095 2CF7 0F48 7AE9 AACE 1EAD 5B2D

To claim this, I am signing this object:

@jbolda
jbolda / local-sqlite.py
Created April 13, 2015 21:31
Use sqlite when local with Alembic
if os.environ.get('DATABASE_URL') is None:
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'app.db') + '?check_same_thread=False'
else:
SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL']
@jbolda
jbolda / photo_creator.py
Created May 12, 2015 01:14
Create docx with table of all pictures in folders
from docx import Document
from docx.shared import Inches
from PIL import Image
import glob
import datetime
import os
import sys
size = 688, 516
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.3.0/knockout-min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
.pinkme {
background-color: pink;
}
@jbolda
jbolda / graph.js
Last active August 29, 2015 14:27
d3 getter setter object
function base() {
console.log('base run')
config = {
rdata: [500],
selector: 'body',
width: 50,
height: 100,
barg: "0"
};
@jbolda
jbolda / states.json
Last active February 18, 2017 00:21
US Cloropeth
{
"states": [{
"abbrev": "HI",
"name": "Hawaii",
"path": "M233.08751,519.30948L235.02744,515.75293L237.2907,515.42961L237.61402,516.23791L235.51242,519.30948L233.08751,519.30948ZM243.27217,515.59127L249.4153,518.17784L251.51689,517.85452L253.1335,513.97465L252.48686,510.57977L248.28366,510.09479L244.24213,511.87306L243.27217,515.59127ZM273.9878,525.61427L277.706,531.11074L280.13092,530.78742L281.26255,530.30244L282.7175,531.59573L286.43571,531.43407L287.40568,529.97912L284.49577,528.20085L282.55584,524.48263L280.45424,520.92609L274.63444,523.83599L273.9878,525.61427ZM294.19545,534.50564L295.48874,532.5657L300.17691,533.53566L300.82356,533.05068L306.96668,533.69732L306.64336,534.99062L304.05678,536.44556L299.69193,536.12224L294.19545,534.50564ZM299.53027,539.67879L301.47021,543.55866L304.54176,542.42703L304.86509,540.81041L303.24848,538.70882L299.53027,538.3855L299.53027,539.67879ZM306.4817,538.54716L308.74496,535.63726L313.43313,538.06218L317.79798,539.19381L322.16284,541.94205L322.16284,543.88198L318.
@jbolda
jbolda / choroplethGraph.js
Last active February 18, 2017 22:42
US Choropleth
//jshint esnext:true
var graph = {}; // we namespace our d3 graph into setup and draw
var stateDataURL = 'states.json';
var statisticsDataURL = 'stats.csv';
graph.setup = () => {
let width = 1000;
let height = 600;
@jbolda
jbolda / README.md
Created March 23, 2023 14:38
Effection v3 And Deno.run

Notes

Run it via deno run -A main.ts. It runs and uses the child_process from Deno.run to run deno run -A server.ts.

We were having issues with the process, a daemon aka long-running process, not sticking around. The commentted sleep() was for testing as opposed to a signal listener.