Skip to content

Instantly share code, notes, and snippets.

View tdavisjr's full-sized avatar

Tyrone Davis tdavisjr

  • Florida, USA
View GitHub Profile
@tdavisjr
tdavisjr / gist:af0bc3468a33074cc64a639f40eebb29
Last active August 7, 2023 03:13
Remove classic asp extension with URL Rewrite and outbound rule rewrite
<rewrite>
<rules>
<rule name="Remove .asp Extension" stopProcessing="true">
<match url="^(.*?)(\.asp)$" />
<action type="Redirect" url="{ToLower:{R:1}}" appendQueryString="true" redirectType="Permanent" />
</rule>
<rule name="Rewrite to .asp" stopProcessing="true">
<match url="^(.*)$" />
<conditions logicalGrouping="MatchAll">
@tdavisjr
tdavisjr / cmdline-publish
Created April 30, 2016 05:31
msbuild command line publish
VS2012+ have these featured built in
msbuild ProjectFile.csproj /p:Configuration=Release ^
/p:Platform=AnyCPU ^
/t:WebPublish ^
/p:WebPublishMethod=FileSystem ^
/p:DeleteExistingFiles=True ^
/p:publishUrl=c:\output
Or if you are building the solution file:
@tdavisjr
tdavisjr / URL_Reqwrite
Last active April 15, 2016 03:49
IIS Outbound Url Rewrite to strip HTML tags of http and make it protocol relative
<!-- outbound rules to modify HTML -->
<outboundRules>
<rule name="Remove protocol under HTTPS" enabled="true">
<match filterByTags="A, Img, Link" pattern="http://(.*)" />
<action type="Rewrite" value="//{R:1}" />
</rule>
</outboundRules>
@tdavisjr
tdavisjr / download_buid_talks.py
Created April 8, 2014 04:50
Updated for Build 2014; but made year an input parameter. This is a Python3 script. Require one third-part package (pip install feedparser). To run, just type >> python download_build_talks.py
#!/usr/bin/python
import os
import urllib.request
import feedparser
import math
import sys
def tofile(title):
@tdavisjr
tdavisjr / build2013_web_dev.py
Last active December 19, 2015 04:29
Python script to download all the Build 2013 Web Developer Related sessions (only). If you like to include all sessions, just modify the url by removing all the querystring parameters. http://channel9.msdn.com/Events/Build/2013 Note: since python requires proper indending, make sure open this file to make sure all indents are tabs or all are spaces
#!/usr/bin/python
import os, urllib, feedparser, math, sys
def handleunicode(title):
return title.encode(encoding='ascii',errors='replace')
def tofile(title):
title = title.replace("?", "-").replace("$", "-").replace("/", "-").replace(":", "-").replace(",", "-").replace("<", "").replace(">","")
@tdavisjr
tdavisjr / teched2013_na_dev.py
Last active December 18, 2015 06:08
Python script for downloading all of the TechEd North America 2013 conference developer related session talks only. I would copy and paste the code in your editor of choice, save it and run it. I have found that when you download these gists file the spacing gets all messed up and for a language like python that would cause the program not to ex…
#!/usr/bin/python
import os, urllib, feedparser, math, sys
def tofile(title):
title = title.replace("?", "-").replace("$", "-").replace("/", "-").replace(":", "-").replace(",", "-").replace("<", "").replace(">","")
return title + ".mp4"
def getsessions():