This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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])) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |