Skip to content

Instantly share code, notes, and snippets.

View joshainglis's full-sized avatar
:octocat:

Josha Inglis joshainglis

:octocat:
View GitHub Profile
@joshainglis
joshainglis / sign_s3_url.sql
Created December 17, 2019 02:42 — forked from darknoon/sign_s3_url.sql
A function that lets you sign S3 urls for viewing from within your database queries
-- This function is based on this description:
-- https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html
CREATE OR REPLACE FUNCTION
sign_s3_url(
m_host text,
m_resource text,
m_region text,
m_key text,
m_secret text,
@joshainglis
joshainglis / daemon.md
Last active August 29, 2015 14:17 — forked from andreif/daemon.md

A simple unix/linux daemon in Python

Source: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/

Access: http://web.archive.org/web/20131025230048/http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/

by Sander Marechal

I've written a simple Python class for creating daemons on unix/linux systems. It was pieced together for various other examples, mostly corrections to various Python Cookbook articles and a couple of examples posted to the Python mailing lists. It has support for a pidfile to keep track of the process. I hope it's useful to someone.

import concurrent.futures
import urllib.request
URLS = ['http://www.foxnews.com/',
'http://www.cnn.com/',
'http://europe.wsj.com/',
'http://www.bbc.co.uk/',
'http://some-made-up-domain.com/']
@joshainglis
joshainglis / cla.py
Last active August 29, 2015 14:09
basic_docopt
def func1(foo):
print("this is func1({})".format(foo))
def func2(foo):
print("this is func2({})".format(foo))
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@joshainglis
joshainglis / Python Plotting.ipynb
Last active August 29, 2015 14:01
Python Plotting
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"metadata": {
"name": "",
"signature": "sha256:f96ce6e9c2cb192094b3c6aae954a354c6e4b05e44715652334735ce8e85fe01"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"metadata": {
"name": "pval"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{