Skip to content

Instantly share code, notes, and snippets.

@adamhepton
adamhepton / package.json
Last active February 3, 2017 15:07
Dirty node.js script that queries the Slack API to find out who has posted most (or least) into a Slack channel of your choice.
{
"name": "channel-stats",
"version": "1.0.0",
"description": "Find out who has posted most into a Slack channel",
"main": "slack.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Adam Hepton <[email protected]>",
"license": "ISC",
@adamhepton
adamhepton / ebay-scraper.js
Created September 8, 2016 14:28
Scrape guts out of ebay auctions. Save into a writable directory, `npm install` and run with `node ebay-scraper.js` followed by as many URLs as you want.
var jsdom = require('jsdom'),
csv = require('json2csv'),
fs = require('fs'),
processed = [],
urls = process.argv.slice(2),
fields = ['title', 'price', 'image', 'date', 'description'];
urls.forEach(function(url) {
jsdom.env(
url,
@adamhepton
adamhepton / ebay-scraper.js
Created September 8, 2016 14:27
Scrape guts out of ebay auctions.
var jsdom = require('jsdom'),
csv = require('json2csv'),
fs = require('fs'),
processed = [],
urls = process.argv.slice(2),
fields = ['title', 'price', 'image', 'date', 'description'];
urls.forEach(function(url) {
jsdom.env(
url,
@adamhepton
adamhepton / keybase.md
Created July 29, 2016 15:15
Keybase Proof

Keybase proof

I hereby claim:

  • I am adamhepton on github.
  • I am prox (https://keybase.io/prox) on keybase.
  • I have a public key ASC70yZzCdhBilWveuMjteIPI4Gi3Fe9W27EVb55h3xsggo

To claim this, I am signing this object:

@adamhepton
adamhepton / bash_aliases
Created October 26, 2015 10:56
Hard reset git branch to state of corresponding remote tracking branch
alias reset='git status -sb | awk -F'\''[/.]'\'' '\''NR==1{print "git reset --hard " $4 "/" $5}'\'' | xargs -I {} sh -c {}'
@adamhepton
adamhepton / .bash_profile
Last active September 4, 2015 10:29
If you SSH between boxes regularly and want a little mental signpost, here's something for 256-colour terminals you might like that gives you colours to use in your prompt based on hostname.
# ... insert this somewhere in your .bash_profile or .bashrc
if [ -f ~/.bash_prompt ]; then
. ~/.bash_prompt
fi
@adamhepton
adamhepton / cards.js
Last active December 16, 2022 19:26
All the Cards Against Humanity cards
module.exports = [
{"id":1,"cardType":"A","text":"Flying sex snakes.","numAnswers":0,"expansion": "Base"},
{"id":2,"cardType":"A","text":"Michelle Obama's arms.","numAnswers":0,"expansion": "Base"},
{"id":3,"cardType":"A","text":"German dungeon porn.","numAnswers":0,"expansion": "Base"},
{"id":4,"cardType":"A","text":"White people.","numAnswers":0,"expansion": "Base"},
{"id":5,"cardType":"A","text":"Getting so angry that you pop a boner.","numAnswers":0,"expansion": "Base"},
{"id":6,"cardType":"A","text":"Tasteful sideboob.","numAnswers":0,"expansion": "Base"},
{"id":7,"cardType":"A","text":"Praying the gay away.","numAnswers":0,"expansion": "Base"},
{"id":8,"cardType":"A","text":"Two midgets shitting into a bucket.","numAnswers":0,"expansion": "Base"},
{"id":9,"cardType":"A","text":"MechaHitler.","numAnswers":0,"expansion": "Base"},
@adamhepton
adamhepton / gist:b1c743110543e9fbf9b5
Created March 6, 2015 09:34
Letter to Ronnie McDonald
Dear Ronnie (can I call you Ronnie, or would you prefer Mr McDonald?),
This morning, we did a breakfast run in our team -- we do one a week for eight to ten people depending on who's in. Every week, there's something slightly wrong: it's never anything huge - a missed Diet Coke here, a Bacon McMuffin instead of a Sausage there, no ketchups, a milk-flavoured milkshake rather than strawberry: I think you get the picture.
Anyway, I'm not here to bag on the excellent staff at Halifax, they rep' you wildstyle, yo, but I wouldn't want to ruin your day's clowning with you thinking everything's all good when there are minor infractions taking place like this.
CAN HAZ VOUCHERS?
@adamhepton
adamhepton / gist:31ca8bf31ea78ebe38dd
Created February 26, 2015 09:28
CookieClicker Save File
MS4wNDY2fHwxNDI0OTQwNTY2OTI3OzE0MjQ3OTcyNzE2NzQ7MTQyNDk0Mjg0Njk2MjtFQVQgTVkgQkFLRUQgR09PRFN8MTExMTExMDExMDB8Njk4NjEwOTIwOTcwNDQyMTAwOzM0NDc5MTk3MzM2MDg0OTIwMDAwOzM4NTk1MDAwOzE1OzM0NDIyMTE4MjI2NzY0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