Skip to content

Instantly share code, notes, and snippets.

@maphew
maphew / readme.md
Last active July 25, 2016 22:28
"Roads and Bridges: the unseen labor behind our digital infrastructure" -- crudely reformatted from PDF to HTML using MS Word 2013. Mostly legible, but has significant layout issues. Refer to original in case of confusion: http://www.fordfoundation.org/library/reports-and-studies/roads-and-bridges-the-unseen-labor-behind-our-digital-infrastructure/

Roads and Bridges: the unseen labor behind our digital infrastructure

by Nadia Eghbal

This is a copy, crudely reformatted from PDF to HTML using MS Word 2013. It has significant layout issues and no images, but should be mostly legible on small screens.

Refer to original in case of confusion:
http://www.fordfoundation.org/library/reports-and-studies/roads-and-bridges-the-unseen-labor-behind-our-digital-infrastructure/

Read rendered gist version:
https://cdn.rawgit.com/maphew/2d0f6b0c9b5d4f96d6f4509b0011b352/raw/b3c0a8c82bd77e7a75bebe9a2672623926fdfb11/roads-and_filtered.html

# ./my_cli/cli.py
# wrapper created for console_scripts to run 'tools/multi_main'
import os
import sys
here = os.path.abspath(os.path.dirname(__file__))
def multi_main(argv):
fname = os.path.join(here, '../tools', 'multi_main.py')
@maphew
maphew / broken-raw-string-example.py
Last active February 21, 2016 20:30
python 2.7.8 broken raw string?
import os
import sys
wspace = r'D:\Feb-19'
tile = '116o'
ex1 = os.path.join(wspace, r'Work_{}\scratch.gdb'.format(tile))
ex2 = os.path.join(wspace, r'\Work_{}\scratch.gdb'.format(tile))
print(sys.version)
print('''\n--- Expected ---
# In ArcGIS Field Calculator, pre-logic script code box:
import numpy
def getMedian(shp):
aList=[]
part=shp.getPart(0)
n=len(part)
for i in xrange(n):
p=part.getObject(i)
z=p.Z
aList.append(z)
@maphew
maphew / Remove-Win10-nag.bat
Last active December 23, 2015 20:47
Implementation of "I Cancelled Microsoft 10 Reservation and uninstalled KB3035583 but Window 10 is still trying to install", http://superuser.com/questions/955444/i-cancelled-microsoft-10-reservation-and-uninstalled-kb3035583-but-window-10-is/
:: --{ Remove-Win10-nag.bat }--
:: http://superuser.com/questions/955444/i-cancelled-microsoft-10-reservation-and-uninstalled-kb3035583-but-window-10-is
:: must be run from elevated command prompt (Run As Administrator)
for %%a in (3035583 3022345 3068708 3075249 3080149 2990214 3012973 2952664 2976978) do (
wusa /uninstall /kb:%%a /norestart /quiet
)
echo Windows Registry Editor Version 5.00 >> "%temp%\disable-win10-upgrade.txt"
echo. >> "%temp%\disable-win10-upgrade.txt"
echo [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\OSUpgrade] >> "%temp%\disable-win10-upgrade.txt"
@maphew
maphew / 2015-Dec-11 - result.txt
Last active June 13, 2019 19:12
From http://stackoverflow.com/a/34116472/14420 in answer to " Extract images from PDF without resampling, in python?"
> pip install --upgrade https://github.com/sylvainpelissier/PyPDF2/archive/master.zip
Collecting https://github.com/sylvainpelissier/PyPDF2/archive/master.zip
C:\Python27\ArcGIS10.3\lib\site-packages\pip\_vendor\requests\packages\urllib3\util\ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
C:\Python27\ArcGIS10.3\lib\site-packages\pip\_vendor\requests\packages\urllib3\util\ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Downloading https://github.com/sylvainpelissier/PyPDF2/archiv
@maphew
maphew / dnld-yt-nhn.cmd
Created December 3, 2015 19:37
Download National Hydrographic Network for Yukon Territory and surround
@echo off
:: rev 0.1 2008.Mar.10, [email protected]
:: rev 0.2 2008.Sept.18 - updated to account for change in ftp source folders
:: rev 0.3 2014.Feb.06 - enable timestamp (only download if source newer)
echo.
echo. -----------------------------------------------------------------------
echo. Going to download National Hydrographic Network Yukon, which could take
echo. awhile. This script can be aborted and rerun, it will resume
echo. where it left off.
echo. -----------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2015-10-27T04:32:20.2209506</Date>
<Author>localhost\Matt</Author>
<Description>Workaround for the capture service halting on suspend/hibernate and resume (https://github.com/codebox/bitmeteros/issues/30). Fires on Startup (30s delay), Logon and Workstation Unlock.</Description>
</RegistrationInfo>
<Triggers>
<SessionStateChangeTrigger>
<Enabled>true</Enabled>
@maphew
maphew / flash-autoupdate.bat
Last active August 29, 2015 14:27 — forked from karlhorky/flash-autoupdate.bat
Trigger Adobe Flash Player Auto-Update mechanism on Windows
:: On-Demand Flash Autoupdate
:: Author: Karl Horky
:: Date: 22 June 2012
:: Version: 0.2
:: Homepage: http://www.karlhorky.com/2012/06/manually-run-autoupdate-for-adobe-flash.html
@echo off
pushd C:\Windows\System32\Macromed\Flash\
if exist *ActiveX.exe (
echo Updating Flash Player Plugin for Internet Explorer