Skip to content

Instantly share code, notes, and snippets.

View schmave's full-sized avatar

Evan Mallory schmave

  • Harrisburg, PA, USA
View GitHub Profile
@djshen-ponddy
djshen-ponddy / customize_wsgi.config
Created October 13, 2017 06:20
Customize AWS Elastic Beanstalk wsgi.conf without being wiped out after update of environment variables
files:
"/opt/elasticbeanstalk/hooks/configdeploy/pre/99patchwsgi.py": &file
mode: "000755"
owner: root
group: root
content: |
#!/usr/bin/env python
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
@gaearon
gaearon / slim-redux.js
Last active May 5, 2024 15:14
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {
@jeromerobert
jeromerobert / extract-data.py
Last active December 12, 2023 18:46
Extract embedded images from svg
#! /usr/bin/env python3
import xml.etree.ElementTree as ET
import sys
import base64
import os
PREFIX="data:image/png;base64,"
ATTR="{http://www.w3.org/1999/xlink}href"
DEFAULT_NS="http://www.w3.org/2000/svg"
with open(sys.argv[1]) as f: