Skip to content

Instantly share code, notes, and snippets.

View wgwz's full-sized avatar
🌱

Kyle Lawlor-Bagcal wgwz

🌱
View GitHub Profile
@wgwz
wgwz / doc2merkle.ipynb
Created September 1, 2022 20:55
pyld-play
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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 / async_get.py
Last active October 8, 2018 23:16
proof of concept paginated api requests using trio and asks
import os
import logging
import asks
import trio
import time
import contextvars
logging.basicConfig(level='DEBUG')
logger = logging.getLogger(__name__)
diff --git a/platter.py b/platter.py
index 2891b6d..8824e38 100644
--- a/platter.py
+++ b/platter.py
@@ -356,7 +356,7 @@ class Builder(object):
python=os.path.basename(self.python),
postinstall=postinstall,
)).encode('utf-8'))
- os.chmod(fn, 0100755)
+ os.chmod(fn, 0o100755)
import tweepy

exec(open('/etc/environment').read())
bot_username = 'RyeArtsCodingC'

def tweet(text):

    auth = tweepy.OAuthHandler(C_KEY, C_SECRET)
 auth.set_access_token(A_TOKEN, A_TOKEN_SECRET)
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
@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)
@app.route("/test_session")
def write():
session['uid']='my_uid'
return session.get('uid')
@app.route("/read_session")
def read():
return session.get('uid')