Skip to content

Instantly share code, notes, and snippets.

View Kevin-Prichard's full-sized avatar

Kevin Prichard Kevin-Prichard

  • Data Metaphysics
  • San Francisco, CA
View GitHub Profile
@avoidik
avoidik / cert_test_pyca.py
Created February 12, 2019 09:15 — forked from rashley-iqt/cert_test_pyca.py
x509Adapter example with pyca/cryptography
import requests
from cryptography.hazmat.primitives.serialization.pkcs12 import load_key_and_certificates
from cryptography.hazmat.primitives.serialization import Encoding, PrivateFormat, NoEncryption
from cryptography.hazmat.backends import default_backend
from requests_toolbelt.adapters.x509 import X509Adapter
backend = default_backend()
with open('test_cert.p12', 'rb') as pkcs12_file:
pkcs12_data = pkcs12_file.read()
@dunhamsteve
dunhamsteve / notion_todo.py
Created December 5, 2018 02:55
reads cached data from Notion.app's localStorage, collects incomplete todo items, and writes them to todo.html
#!/usr/bin/env python3
# This is written for OSX, python3, and the current (2018-12-04) version of the Notion app
# It writes incomplete todo items, found in Notion's localStorage, to a "todo.html" file,
# with links back to the Notion app
import os
import sqlite3
import json
from html import escape
@protrolium
protrolium / ffmpeg.md
Last active May 2, 2024 12:02
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

You can get the list of installed codecs with:

@textarcana
textarcana / git-log2json.sh
Last active March 1, 2024 05:26
Convert Git logs to JSON. The first script (git-log2json.sh) is all you need, the other two files contain only optional bonus features 😀THIS GIST NOW HAS A FULL GIT REPO: https://github.com/context-driven-testing-toolkit/git-log2json
#!/usr/bin/env bash
# Use this one-liner to produce a JSON literal from the Git log:
git log \
--pretty=format:'{%n "commit": "%H",%n "author": "%aN <%aE>",%n "date": "%ad",%n "message": "%f"%n},' \
$@ | \
perl -pe 'BEGIN{print "["}; END{print "]\n"}' | \
perl -pe 's/},]/}]/'