Skip to content

Instantly share code, notes, and snippets.

Automate Everything

Craig Derington craigderington

Automate Everything
  • Python Development Systems, LLC.
  • Sanford, FL
View GitHub Profile
craigderington / json_api_server.js
Created Jun 29, 2016
JSON API Server for NodeJS
View json_api_server.js
var http = require('http');
var url = require('url');
var portNumber = Number(process.argv[2]);
function parseTime(time) {
return {
hour: time.getHours(),
minute: time.getMinutes(),
second: time.getSeconds()
bkdinoop / login-example
Last active Feb 11, 2021
Flask-Login : created by : Matthew Frazier
View login-example
# -*- coding: utf-8 -*-
Flask-Login example
This is a small application that provides a trivial demonstration of
Flask-Login, including remember me functionality.
:copyright: (C) 2011 by Matthew Frazier.
:license: MIT/X11, see LICENSE for more details.
philfreo /
Created Jun 21, 2013
A Flask view that returns HTML or generates a PDF
import mimerender
mimerender.register_mime('pdf', ('application/pdf',))
mimerender = mimerender.FlaskMimeRender(global_charset='UTF-8')
def render_pdf(html):
from xhtml2pdf import pisa
from cStringIO import StringIO
pdf = StringIO()
pisa.CreatePDF(StringIO(html.encode('utf-8')), pdf)
rgreenjr / postgres_queries_and_commands.sql
Last active Mar 4, 2021
Useful PostgreSQL Queries and Commands
View postgres_queries_and_commands.sql
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
ibeex / foo.log
Created Aug 4, 2012
Flask logging example
View foo.log
A warning occurred (42 apples)
An error occurred
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:


start new with session name:

tmux new -s myname