Skip to content

Instantly share code, notes, and snippets.

View mkedwards's full-sized avatar

Michael K. Edwards mkedwards

  • Corista, LLC
  • 02:08 (UTC -07:00)
View GitHub Profile
@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])) {
@mmurdoch
mmurdoch / Get dateutil.py
Created November 6, 2012 18:18
Get dateutil
import os
import urllib2
import tarfile
import shutil
workingPath = os.getcwd()
tempPath = os.path.join(workingPath, 'temp')
dateutilArchiveDir = 'python-dateutil-1.5'
dateutilArchive = dateutilArchiveDir + '.tar.gz'
dateutilArchivePath = os.path.join(tempPath, dateutilArchive)
@mmurdoch
mmurdoch / Get Github Library.py
Last active April 29, 2023 19:45
Download github library for Pythonista.
# Note that this script attempts to delete directories (Folders) called 'temp' and 'dateutil'
# within Pythonista as part of installation. It will also overwrite files in directories
# named 'github' and 'githubista'. If you are using Pythonista 1.3 or above please check
# that you have not created any Folders with these names before running this script as
# any files inside them will be irretrievably lost.
import os
import urllib2
import tarfile
import shutil
import traceback