Skip to content

Instantly share code, notes, and snippets.

View jeremypage's full-sized avatar

Jeremy Page jeremypage

  • Trafford Council
  • UK
View GitHub Profile
@jeremypage
jeremypage / ogr2ogr.cmd
Created February 3, 2015 12:46
ogr2ogr: Convert MapInfo TAB file to geoJSON (British National Grid projection)
ogr2ogr -f "GeoJSON" -a_srs "EPSG:27700" output.geojson input.TAB
@jeremypage
jeremypage / TAB2geoJSON.cmd
Last active June 13, 2022 01:20
Convert all MapInfo TAB files in folder to geoJSON (change projection from British National Grid to Longitude / Lattitude WGS84)
for /r %i in (*.TAB) do ogr2ogr -f "GeoJSON" %i.geojson %i -s_srs EPSG:27700 -t_srs EPSG:4326
@jeremypage
jeremypage / connected-users.sql
Created February 6, 2015 15:27
Query connected users on SQL Server databases
SELECT @@ServerName AS SERVER
,NAME
,login_time
,last_batch
,getdate() AS DATE
,STATUS
,hostname
,program_name
,nt_username
,loginame
@jeremypage
jeremypage / gdal-cheat-sheet.md
Created February 7, 2015 07:08
Cheat sheet for GDAL/OGR command-line tools (from https://github.com/dwtkns/gdal-cheat-sheet)

Cheat sheet for GDAL/OGR command-line geodata tools

Vector operations

Get vector information

ogrinfo -so input.shp layer-name

Or, for all layers

@jeremypage
jeremypage / google-analytics-extras.js
Last active October 8, 2018 16:50
Enable tracking of many links and downloads that cannot normally be tracked in Google Analytics (from http://www.blastam.com/blog/index.php/2013/03/how-to-track-downloads-in-google-analytics-v2)
// Enables us to track many links and downloads that cannot normally be tracked in Google Analytics
jQuery(document).ready(function($) {
var filetypes =
/\.(zip|exe|dmg|pdf|doc.*|xls.*|ppt.*|mp3|txt|rar|wma|mov|avi|wmv|flv|wav)$/i;
var baseHref = '';
if (jQuery('base').attr('href') != undefined) baseHref = jQuery(
'base').attr('href');
jQuery('a').on('click', function(event) {
var el = jQuery(this);
@jeremypage
jeremypage / system-down.html
Last active August 29, 2015 14:16
System down holding page for Trafford Council
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html lang="en-gb" class="no-js">
<!--<![endif]-->
<head>
<meta charset="utf-8">
temp1 := ZnEasy get: 'address in here'.
trello := NeoJSONReader fromString: temp1 entity.
trelloLists := trello at:'lists'.
trelloCards := trello at:'cards'.
trelloLists do: [ :each|| listId |
listId := each at:'id'.
each at:'cards' put: ((trelloCards select:[:item|(( item at:'idList')=listId)])collect:[:item| item at:'name']).
].
@jeremypage
jeremypage / github-style-ordered-list.css
Last active August 29, 2015 14:18
CSS: More attractive ordered list style, as used in GitHub Help pages. Displays big bold numbers and a right border.
ol {
counter-reset: li;
list-style: none;
margin: 0;
padding: 0
}
ol>li {
position: relative;
margin-bottom: 1em
@jeremypage
jeremypage / powershell-cheatsheet.md
Last active April 17, 2025 08:14
Powershell cheatsheet

Powershell Cheatsheet

Get all AD properties of user:

Get-ADUser %username% -properties *
@jeremypage
jeremypage / recursive-file-change-list.cmd
Created April 9, 2015 09:07
Powershell: Recursively list all files in folder with last change date (from http://stackoverflow.com/a/13345137)
get-childitem E:\search-folder -rec | where {!$_.PSIsContainer} | select-object FullName, LastWriteTime, Length | export-csv -notypeinformation -delimiter '|' -path file.csv