Skip to content

Instantly share code, notes, and snippets.


Peter W techieshark

View GitHub Profile
View CLA-school-finder
# Contributor License Agreement
The following terms are used throughout this agreement:
* You - the person or legal entity including its affiliates asked to accept this agreement. An affiliate is any entity that controls or is controlled by the legal entity, or is under common control with it.
* Project - School Finder project located at
* Contribution - any type of work that is submitted to a Project, including any modifications or additions to existing work.
* Submitted - conveyed to a Project via a pull request, commit, issue, or any form of electronic, written, or verbal communication with GitHub, Code for Australia, Peter W, contributors or maintainers.
1. Grant of Copyright License.
View gist:33950a2b88652fde21415c50a42a3d80
open -a "/Applications/Google" '' --args --enable-dom-distiller
# Now go to Menu -> Distill Page (on an article page, like the example above)
techieshark / documentation.json
Created Jul 15, 2016
Elm documentation example file
View documentation.json
"name": "Data",
"comment": "Data module overview.\n\n#Single items\n\n\n@docs getItem\n\n",
"aliases": [],
"types": [],
"values": [
"name": "getItem",
"comment": "Get item from app data store.",
# want to quickly see how large (in bytes) a file is after we gzip it, without actually gzipping it
# on command line, running the following does the trick: gzip -c file.js | wc -c
# we can add this little bit to our .bashrc so we can instead just type gsize file.js
gzipSize() {
gzip -c $1 | wc -c
alias gsize=gzipSize
techieshark / git-rebase.log
Created Mar 9, 2015
git rebasing municipal
View git-rebase.log
peter@Selene:~/mesa-municipal(master)$ git pull
remote: Counting objects: 7, done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 7 (delta 0), reused 0 (delta 0), pack-reused 1
Unpacking objects: 100% (7/7), done.
1d0be4e..53f4d71 master -> origin/master
* [new branch] master_bu_03-05-15 -> origin/master_bu_03-05-15
* [new branch] mesa-customized_bu_03-05-15 -> origin/mesa-customized_bu_03-05-15
Updating 1d0be4e..53f4d71
View console.js
* Protect window.console method calls, e.g. console is not defined on IE
* unless dev tools are open, and IE doesn't define console.debug
(function() {
if (!window.console) {
window.console = {};
// union of Chrome, FF, IE, and Safari console methods
techieshark /
Created Jan 29, 2015
Cleaning Mesa's downstream repo / syncing with CfA
# This is kind of long. It should be a lot simpler in the future, once these steps are done.
# Clone repo:
git clone mesa-municipal
# get into repo
cd mesa-municipal
# Add the upstream repository:
git remote add upstream
techieshark /
Created Jan 29, 2015
Syncing techieshark -> mesa Council Info:
git clone mesa-council-info
cd mesa-council-info/
git remote -v #view remotes already setup. looks like we need to add one:
git remote add techieshark
git fetch techieshark gh-pages
git merge techieshark/gh-pages
git push #push to origin with the new additions
techieshark / find-twitters.js
Created Dec 12, 2014
View find-twitters.js
// first make sure jQuery and Lo-Dash are in the browser by running
var links =$('a'), function(a) { return $(a).attr('href')});
var twitters = _.filter(links, function(l) { return l && l.match(/twitter/) });
techieshark / copy-into-browser.js
Last active Nov 9, 2018
View copy-into-browser.js
// For quickly trying things out in the browser, jQuery and Lo-Dash (like Underscore.js) are great.
// Read the code below (never copy & paste code you don't trust),
// then you can copy & paste it into the browser console to load jQuery & lodash.
(function () {
var jq = document.createElement('script');
jq.src = '';