Skip to content

Instantly share code, notes, and snippets.

View jeremypage's full-sized avatar

Jeremy Page jeremypage

  • Trafford Council
  • UK
View GitHub Profile
for /F %x in (websites.txt) do nslookup -q=ns %x
@jeremypage
jeremypage / web.config
Created April 10, 2015 10:59
IIS: Enable json/geojson MIME types
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".json" mimeType="application/json" />
<mimeMap fileExtension=".geojson" mimeType="application/json" />
</staticContent>
<handlers>
<add name="geoJSON" path=".geojson" verb="*" modules="IsapiModule" scriptProcessor="C:\WINDOWS\system32\inetsrv\asp.dll" resourceType="Unspecified" />
<add name="JSON" path=".json" verb="*" modules="IsapiModule" scriptProcessor="C:\WINDOWS\system32\inetsrv\asp.dll" resourceType="Unspecified" />
@jeremypage
jeremypage / git-cheatsheet.md
Last active May 5, 2025 06:31
Git cheatsheet

Git cheatsheet

Find all instances of text in all commits

git grep "text to look for" $(git rev-list --all)

List commit messages since given commit

@jeremypage
jeremypage / IsMemberOf.vb
Last active August 29, 2015 14:25
LDAP: Check if logged in user is member of domain group(s). Uses alternative credentials to log on to domain controller.
Function IsMemberOf()
' Checks if logged in user is member of LDAP groups (group1, group2)
IsMemberOf = False
Const ADS_SECURE_AUTHENTICATION = 1
Const ADS_SERVER_BIND = &h0200
strUser = "***domain user name***"
@jeremypage
jeremypage / userDefineLang.xml
Created July 23, 2015 15:22
Notepad++: userDefineLang.xml for Markdown (from https://github.com/jjchiw/markdown_npp)
<NotepadPlus>
<UserLang name="MarkDown" ext="md markdown" udlVersion="2.1">
<Settings>
<Global caseIgnored="yes" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" />
<Prefix Keywords1="yes" Keywords2="yes" Keywords3="yes" Keywords4="yes" Keywords5="yes" Keywords6="no" Keywords7="no" Keywords8="no" />
</Settings>
<KeywordLists>
<Keywords name="Comments">00# 01 02 03&lt;!-- 04--&gt;</Keywords>
<Keywords name="Numbers, prefix1"></Keywords>
<Keywords name="Numbers, prefix2"></Keywords>
@jeremypage
jeremypage / log4net-boilerplate.cs
Created September 15, 2015 10:31
Log4net: Boilerplate code
public class Foo
{
private static readonly ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
... other code
}
@jeremypage
jeremypage / git-loglive
Last active November 26, 2015 15:25 — forked from tlberglund/git-loglive
Log Live Git Command
#!/bin/sh
while :
do
clear
git log --graph --all --color --date=short -20 --pretty=format:"%C(yellow)%h%x20%C(white)%cd%C(green)%d%C(reset)%x20%s%x20%C(bold)(%an)%Creset" |
cat -
sleep 10
done
@jeremypage
jeremypage / 45-75.js
Created November 23, 2015 12:50
Bookmarklet to high light optimum line reading length (45-75 characters). From CSS-Tricks (https://css-tricks.com/bookmarklet-colorize-text-45-75-characters-line-length-testing/)
javascript:(function(){function loadScript(a,b){var c=document.createElement('script');c.type='text/javascript';c.src=a;var d=document.getElementsByTagName('head')[0],done=false;c.onload=c.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=='loaded'||this.readyState=='complete')){done=true;b()}};d.appendChild(c)}loadScript('//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js',function(){var redOutline={outline:'2px solid red'},text;var textyElements='p, li, dt, dd, h1, h2, h3, h4, h5, h6';$(textyElements).on('mouseover.red',function(){$(this).css(redOutline)}).on('mouseleave.red',function(){$(this).removeAttr('style')}).on('click.red',function(){text=$(this).text();var e=text.substring(0,45);var t=text.substring(45,75);var n=text.substring(75,text.length);var r=e+'<span style=\'color: red;\'>'+t+'</span>'+n;$(this).html(r);$(textyElements).off('mouseover.red mouseleave.red click.red');$(this).removeAttr('style');})})})()
@jeremypage
jeremypage / tscb-logo.svg
Created November 26, 2015 09:31
TSCB logo
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jeremypage
jeremypage / wget-entire-site-copy.cmd
Created December 7, 2015 10:51
WGET: Get entire contents of given website. Ignores robots.txt to ensure all content is retrieved. Uses local proxy (CNTLM) to negotiate corporate proxy.
wget -e http_proxy=127.0.0.1:3128 robots=off --recursive --no-clobber --page-requisites --html-extension --convert-links --domains www.foobar.com www.foobar.com