Skip to content

Instantly share code, notes, and snippets.

Avatar

Natalie Downe natbat

View GitHub Profile
@natbat
natbat / Bat+Sounds.ipynb
Last active Oct 29, 2017
Taking recordings from the EchoMeter Touch Bat detector and the KML file that is associated with it and uploading the sound files
View Bat+Sounds.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View addSizes.js
jQuery(function($){
// addSizes was written by Natalie Downe
// http://natbat.net/2008/Aug/27/addSizes/
// Copyright (c) 2008, Natalie Downe under the BSD license
// http://www.opensource.org/licenses/bsd-license.php
$('a[href$=".pdf"], a[href$=".doc"], a[href$=".mp3"], a[href$=".jpg"], a[href$=".png"], a[href$=".swf"], a[href$=".zip"], a[href$=".ogg"], a[href$=".m4u"]').each(function(){
// looking at the href of the link, if it contains pdf, doc, zip, mp3, ogg, m4u, jpg, png, swf
@natbat
natbat / legacy-db-conversion.py
Created Apr 7, 2016
Conversion script is for writing legacy data to a csv file suitable for wordpress import - by Matthew Antone
View legacy-db-conversion.py
# TODO:
# . add alt tags to image links
# . image thumbnails? (featured image)
import psycopg2
import psycopg2.extras
import re
import lxml
@natbat
natbat / django dates
Created Jan 20, 2013
Better django date formatting eg "1:21pm, January 2nd, 2013"
View django dates
{{object.date|date:"fA"|lower}}, {{object.date|date:"F jS, Y"}}
@natbat
natbat / gist:4109493
Created Nov 19, 2012
18th November 2012 hamster.log
View gist:4109493
Revolutions: 1 (time = 1353270795.1)
Revolutions: 2 (time = 1353270820.32)
Revolutions: 3 (time = 1353275042.99)
Revolutions: 4 (time = 1353275045.56)
Revolutions: 5 (time = 1353275051.18)
Revolutions: 6 (time = 1353275057.6)
Revolutions: 7 (time = 1353275063.12)
Revolutions: 1 (time = 1353275203.54)
Revolutions: 2 (time = 1353275959.26)
Revolutions: 3 (time = 1353275962.48)
@natbat
natbat / Django nice times
Created Apr 10, 2012
9am to 9:30am in django templating
View Django nice times
{{ session.start_time|date:"g" }}{% with session.start_time|date:"i" as mm %}{% if mm != "00" %}{{ session.start_time|date:":i" }}{% endif %}{% endwith %}{{ session.start_time|date:"A"|lower }}
@natbat
natbat / spreadsheet-template.txt
Last active Sep 29, 2015
Template for videos and notes in spreadsheets to output docs code
View spreadsheet-template.txt
=IF(ISBLANK(F5),"", B5 & CHAR(10) & "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^" & CHAR(10) & TEXT(A5, "mmmm d yyyy") & " a "& D5& " by " & E5 & CHAR(10) & CHAR(10) & IF(ISBLANK(F5),"", Concat("`Video <https://www.youtube.com/watch?v=", Concat(F5, ">`__, "))) & IF(ISBLANK(G5),"", Concat("`Author slides/docs <", Concat(G5, ">`__, "))) & IF(ISBLANK(H5),"", Concat("`Collective notes <", Concat(H5, ">`__, "))) & CHAR(10) & CHAR(10) & C5 & CHAR(10) & CHAR(10) & CHAR(10))
@natbat
natbat / Mailto
Created Jan 18, 2012
Mailto formatting
View Mailto
mailto:jsmith@example.com?subject=A%20Test&amp;body=My%20idea%20is%3A%20%0A
@natbat
natbat / Pluralize
Created Jan 18, 2012
pluralize in django to be two words
View Pluralize
{{ group.adverts|length|pluralize:"this,these" }}