Skip to content

Instantly share code, notes, and snippets.

View mhemmings's full-sized avatar
UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS

Mark Hemmings mhemmings

UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS
View GitHub Profile
@mhemmings
mhemmings / main.go
Created February 2, 2018 14:46
Bulk create Cloudwatch alarms for 4xx/5xx API Gateway errors. Tweak for your needs.
package main
import (
"fmt"
"log"
"strings"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/cloudwatch"
@mhemmings
mhemmings / main.go
Last active February 2, 2018 14:48
Bulk create Cloudwatch alarms for 4xx/5xx API Gateway errors.
package main
import (
"fmt"
"log"
"strings"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/cloudwatch"
@mhemmings
mhemmings / gh-project-text.js
Created November 1, 2017 18:11
One line of JS to paste into the console, which puts the Github project status onto the clipboard in a simple easy to read text format for Slack/emails/whatever
for(var name,columns=document.querySelectorAll('.project-columns-container>.project-column'),str='',i=0;i<columns.length;++i){name=columns[i].querySelector('.js-project-column-name').innerHTML,str+=`${name}\n`;for(var cards=columns[i].querySelectorAll('.project-card>div>a'),j=0;j<cards.length;j++)str+=`- ${cards[j].innerHTML.trim()}\n`;str+='\n'}copy(str);
@mhemmings
mhemmings / gh-project-text.js
Created November 1, 2017 18:10
One line of JS to paste into the console, which puts the Github project status onto the clipboard in a simple easy to read text format
for(var name,columns=document.querySelectorAll('.project-columns-container>.project-column'),str='',i=0;i<columns.length;++i){name=columns[i].querySelector('.js-project-column-name').innerHTML,str+=`${name}\n`;for(var cards=columns[i].querySelectorAll('.project-card>div>a'),j=0;j<cards.length;j++)str+=`- ${cards[j].innerHTML.trim()}\n`;str+='\n'}copy(str);
@mhemmings
mhemmings / Makefile
Last active January 9, 2021 05:40
EB Deploy Makefile
VERSION=$(shell git rev-parse --short HEAD)
DESC=$(shell git log -1 --pretty=%B)
BUCKET_NAME="your-eb-s3-bucket"
PROJECT_NAME=$(shell basename $(shell pwd))
REGION="eu-west-1"
ifndef ENV
$(error No environment ENV is defined)
endif
@mhemmings
mhemmings / delete-from-lib.sh
Created July 27, 2016 20:44
Delete the word "WORD" from the OSX user's dictionary after being added with the "Add To Dictionary" dropdown
sed -i -e "s/WORD//g" /Users/$(whoami)/Library/Spelling/LocalDictionary
@mhemmings
mhemmings / README.md
Created May 3, 2016 13:17
cp-drawables.sh

Copy Android drawable assets from one directory to another using the standard drawables-hdpi, drawables-xhdpi etc

It can be a pain to copy new assets into your Android project when they are provided in the correct dpi directory structure. Inside the source res directory, you should have child directorys of drawables-hdpi, drawables-xhdpi etc which each contain the asset needed to copy. The destination directory should also be the res directory containing each drawables directory.

Example: ./cp-drawables.sh img_to_copy.png /path/to/res/dir

Will execute (and print out):

@mhemmings
mhemmings / work.sh
Created March 31, 2015 16:53
Block Facebook and Twitter in your hosts file with one command: 'work'
alias work='echo -e "127.0.0.1 www.facebook.com\n127.0.0.1 twitter.com" | sudo tee -a /etc/hosts > /dev/null'
@mhemmings
mhemmings / VPCF11J0E.md
Created March 10, 2015 20:06
Sony VPCF11J0E For Sale

Sony VPCF11J0E. Just shy of £1000 when new.

  • Intel® Core™ i5-520M Processor 2.4GHz, 4.8GT/s, 3MB L3 Cache
  • Windows® 7 Home Premium 64-bit
  • 6GB DDR3 SDRAM
  • NVIDIA® 1GB GeForce® GT 330M GPU
  • 16.4" 1920 x 1080 pixels
  • Hard drive 320GB SATA
  • Blu-ray Disc™ Player: BD ROM/ DVD Rewriter
  • SD card slot

Keybase proof

I hereby claim:

  • I am mhemmings on github.
  • I am mhemmings (https://keybase.io/mhemmings) on keybase.
  • I have a public key whose fingerprint is EF6F 5F5D D3AC D8A2 6FA8 F6B9 1401 546F C018 6858

To claim this, I am signing this object: