Skip to content

Instantly share code, notes, and snippets.

Avatar

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 https://github.com/CodeforAustralia/school-finder
* 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 Chrome.app" 'https://grist.org/politics/trumps-environmental-assault-continues-and-now-hell-have-pruitt-as-a-henchman/' --args --enable-dom-distiller
# Now go to Menu -> Distill Page (on an article page, like the example above)
@techieshark
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.",
View gzip-size.sh
# 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
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.
From github.com:CityOfMesaAZ/Municipal
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
* http://stackoverflow.com/a/13817235/1024811
*/
(function() {
if (!window.console) {
window.console = {};
}
// union of Chrome, FF, IE, and Safari console methods
@techieshark
techieshark / lots-o-git.sh
Created Jan 29, 2015
Cleaning Mesa's downstream repo / syncing with CfA
View lots-o-git.sh
# This is kind of long. It should be a lot simpler in the future, once these steps are done.
# Clone repo:
git clone https://github.com/CityOfMesaAZ/MuniciPal.git mesa-municipal
# get into repo
cd mesa-municipal
# Add the upstream repository:
git remote add upstream https://github.com/codeforamerica/MuniciPal.git
@techieshark
techieshark / update-council-info.sh
Created Jan 29, 2015
Syncing techieshark -> mesa Council Info:
View update-council-info.sh
git clone git@github.com:CityOfMesaAZ/council-info.git 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 https://github.com/techieshark/council-info.git
git fetch techieshark gh-pages
git merge techieshark/gh-pages
git push #push to origin with the new additions
@techieshark
techieshark / find-twitters.js
Created Dec 12, 2014
get-all-twitter-links
View find-twitters.js
// first make sure jQuery and Lo-Dash are in the browser by running https://gist.github.com/techieshark/45d6f183f80835757336
var links = _.map($('a'), function(a) { return $(a).attr('href')});
var twitters = _.filter(links, function(l) { return l && l.match(/twitter/) });
twitters.join('\n');
@techieshark
techieshark / copy-into-browser.js
Last active Nov 9, 2018
jquery-and-lodash-in-console
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 = 'https://code.jquery.com/jquery-2.1.4.js';