I hereby claim:
- I am thomseddon on github.
- I am thomseddon (https://keybase.io/thomseddon) on keybase.
- I have a public key whose fingerprint is F5A5 8053 B6B2 9FE9 C90D 4459 A531 B220 A925 2B68
To claim this, I am signing this object:
| function doPost(req) { | |
| var date = new Date(); | |
| var hour = date.getHours(); | |
| var day = date.getDay(); | |
| // Normal support | |
| if (hour >= 9 && hour <= 17 && day >= 1 && day <= 5) | |
| return ContentService.createTextOutput('Normal support'); | |
| // Parse body |
I hereby claim:
To claim this, I am signing this object:
| find . -name '*' ! -type d -exec bash -c 'expand -t 2 "$0" > /tmp/e && mv /tmp/e "$0"' {} \; |
| #!/bin/bash | |
| # | |
| # Copyright Thom Seddon 2015 | |
| # MIT | |
| # | |
| if [ "$1" == "" ] || [ "$1" == "help" ]; then | |
| echo "Usage: ~/.proxy <option>" | |
| echo | |
| echo " Options: " |
| # Test: | |
| $ curl http://127.0.0.1:3000 | |
| # With debug set to true | |
| $ node test.js | |
| OAuth2Error: The access token was not found | |
| at OAuth2Error (/home/thom/Dev/node/t/node_modules/oauth2-server/lib/error.js:30:12) | |
| at Authorise.getBearerToken (/home/thom/Dev/node/t/node_modules/oauth2-server/lib/authorise.js:70:17) | |
| at run (/home/thom/Dev/node/t/node_modules/oauth2-server/lib/runner.js:15:14) | |
| at runner (/home/thom/Dev/node/t/node_modules/oauth2-server/lib/runner.js:19:5) |
| var buggyAndroid = parseInt((/android (\d+)/.exec(window.navigator.userAgent.toLowerCase()) || [])[1], 10) < 4; | |
| if (!history.pushState || buggyAndroid) { | |
| if (window.location.hash) { | |
| if(window.location.pathname !== '/') window.location.replace('/#!' + window.location.hash.substr(2)); //Hash and a path, just keep the hash (redirect) | |
| } else { | |
| window.location.replace('/#!' + window.location.pathname); //No hash, take path | |
| } | |
| } | |
| //And then in app.config: |
| sshs () { | |
| case $1 in | |
| vps) ssh name@domain.com ;; | |
| aws) ssh ec2-user@really-long-aws-domain.com -p 2222 ;; | |
| client) ssh client@clientdomain.com ;; | |
| *) echo "Dont know '$1', sorry" ;; | |
| esac | |
| } |
| #!/bin/bash | |
| # | |
| # Usage: ./gitclean.sh <branch> <path-to-match> | |
| # Requires clean working tree (i.e. delete files in <path> and commit) | |
| # | |
| # Thom Seddon <thom@seddonmedia.co.uk> | |
| git ls-tree --name-only -r $1 $2 | while read FILE; do | |
| git filter-branch --index-filter "git rm --cached ${FILE}" HEAD | |
| done |
| #!/usr/bin/env bash | |
| set -e | |
| set -x | |
| ### How To Use | |
| # | |
| # sudo bash -c 'bash \ | |
| # <(curl -sLB https://raw.github.com/gist/5080906/bootstrap_chef_server_rpm.sh) \ | |
| # --hostname foo.example.com' | |
| # |
| var session = express.session(); | |
| // Slightly Invasive | |
| app.get('/home', session, routes.home); | |
| app.get('/about', routes.about); | |
| app.get('/faq', routes.faq); | |
| // or | |
| // Crude |