Skip to content

Instantly share code, notes, and snippets.

:: Install IIS 7.5
:: https://technet.microsoft.com/en-us/library/cc725762.aspx
start /w pkgmgr /iu:IIS-WebServerRole;^
IIS-WebServer;^
IIS-ApplicationDevelopment;^
IIS-ASPNET;^
IIS-NetFxExtensibility;^
IIS-ISAPIExtensions;^
IIS-ISAPIFilter;^
IIS-Security;^
[System.Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Python27\ArcGIS10.4;C:\Python27\ArcGIS10.4\Scripts", "User")
[System.Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Users\ccooper\AppData\Local\Pandoc", "User")
[System.Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Program Files\7-Zip", "Machine")
[System.Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Program Files\nodejs", "User")
pip install sphinx
pip install sphinx_rtd_theme
pip install virtualenv
pip install virtualenvwrapper-win
pip install boto3==1.2.3
pip install configobj
pip install python-dateutil
pip install pytz
npm install -g json
choco install nodejs -y
choco install kdiff3 -y
choco install pandoc -y
choco install 7zip -y
choco install -y git -params '"/GitAndUnixToolsOnPath"'
choco install firefox -y
choco install inkscape -y
choco install notepad2-mod -y
choco install brackets -y
choco install cutepdf -y
import sys
import json
fields = sys.argv[1]
aliases = sys.argv[2]
@chadcooper
chadcooper / micro-python-hacking.py
Last active August 29, 2015 14:02
Most of this comes straight from the tutorials at http://micropython.org/doc/tut-contents.
# On OSX
# Connect via USB, open up Terminal, launch interactive REPL to Micro Python
$ screen /dev/tty.usbmodem*
# You'll get a prompt
Micro Python v1.0.1 on 2014-05-12; PYBv1.0 with STM32F405RG
Type "help()" for more information.
>>>
# Play around with the LEDs
@chadcooper
chadcooper / md-counties.py
Created February 19, 2014 01:26
County FIPS codes for Maryland.
{'ALLEGANY': '001',
'ANNE ARUNDEL': '003',
'BALTIMORE': '005',
'BALTIMORE CITY': '510',
'CALVERT': '009',
'CAROLINE': '011',
'CARROLL': '013',
'CECIL': '015',
'CHARLES': '017',
'DORCHESTER': '019',
{'01': ['AL', 'ALABAMA'],
'02': ['AK', 'ALASKA'],
'04': ['AZ', 'ARIZONA'],
'05': ['AR', 'ARKANSAS'],
'06': ['CA', 'CALIFORNIA'],
'08': ['CO', 'COLORADO'],
'09': ['CT', 'CONNECTICUT'],
'10': ['DE', 'DELAWARE'],
'11': ['DC', 'DISTRICT OF COLUMBIA'],
'12': ['FL', 'FLORIDA'],
@chadcooper
chadcooper / ogr-pull-state.sh
Last active August 29, 2015 13:56
Open tl_2013_us_county.shp, select records where STATEFP = 24 (Maryland), write out those geometries and the STATEFP, COUNTYFP, and NAME fields only to 24.shp. Overwrite 24.shp if it exists.
#!/bin/bash
ogr2ogr -f "ESRI Shapefile" 24.shp -overwrite -select STATEFP,COUNTYFP,NAME -where "STATEFP = '24'" tl_2013_us_county.shp
-- All my answers
-- All my answers on the site
DECLARE @UserId int = ##UserId##
DECLARE @Year int = ##Year##
SELECT
a.Id AS [Post Link],
CASE WHEN q.AcceptedAnswerId=a.Id THEN 'Accepted' END AS Accepted,
CASE WHEN q.OwnerUserId=a.OwnerUserId THEN 'Self' END AS Self,