Skip to content

Instantly share code, notes, and snippets.

View michaw's full-sized avatar

Micha Wotton michaw

  • Sydney, Australia
View GitHub Profile
@michaw
michaw / lambda_function.py
Created November 12, 2020 03:52
AWS Lambda - cloudwatch-alarm-to-slack-python blueprint extended
'''
Follow these steps to configure the webhook in Slack:
1. Navigate to https://<your-team-domain>.slack.com/services/new
2. Search for and select "Incoming WebHooks".
3. Choose the default channel where messages will be sent and click "Add Incoming WebHooks Integration".
4. Copy the webhook URL from the setup instructions and use it in the next section.
#!/bin/bash
echo -e "\nbenchmark.sh -n<number of requests> -c<number of concurrency> <line tittle>:<URL1> <line tittle>:<URL2> ..."
echo -e "\nEx: benchmark.sh -n100 -c10 google:http://www.google.com/ bing:http://www.bing.com/ \n"
## Gnuplot settings
echo "set terminal png
set output 'benchmark_${1}_${2}.png'
set title 'Benchmark: ${1} ${2}'
@michaw
michaw / import.js
Created September 4, 2014 07:01
jQuery script for using HTMLImport as HTML templates
/**
* @author: Micha Wotton
* @version: 0.1
*
* To import an HTML file and inject it's content into a target container.
* Uses an additional data attribute on the 'link' element to identify target element.
* Format link tags as follows:
* <link type="import" href="path/to/import.html" dat-target="targetElementID">
*
* You can also use further imports within imported files. This script will recursively inject them,
@michaw
michaw / git-selective-merge.md
Created September 13, 2012 11:45 — forked from katylava/git-selective-merge.md
git selective merge

Example: You have a branch refactor that is quite different from master. You can't merge all of the commits, or even every hunk in any single commit or master will break, but you have made a lot of improvements there that you would like to bring over to master.

On master:

> git co -b temp

On temp: