This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Mastodon Follow Locally Mod | |
// @namespace http://www.grahamlea.com/ | |
// @version 0.1 | |
// @description Allows you to follow Mastodon accounts from other servers more easily | |
// @author Graham Lea (@evolvable@aus.social) | |
// @match https://*/* | |
// @require http://code.jquery.com/jquery-latest.js | |
// @grant none | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Remove containers whose name matches the automatic naming pattern (adjective_name). Won't affect running containers. | |
docker rm $(docker ps -a | awk '{print $NF}' |egrep '^[a-z]+_[a-z]+$') | |
# Delete images that don't have any tags or containers. | |
docker image prune -f | |
# Delete unused volumes | |
docker volume prune -f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
// TODO: Replace the percentages and names below with those relevant to your website | |
var percentagesToReport = new Map(); | |
percentagesToReport.set(25, 'Section2'); | |
percentagesToReport.set(50, 'Section3'); | |
percentagesToReport.set(75, 'Section4'); | |
percentagesToReport.set(90, 'Section5'); | |
function reportScroll(scrollLocationName) { | |
gtag('event', scrollLocationName, { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
THIS IS A TEMPLATE: | |
* CHANGE THE SALUTATION AT THE START | |
* UPDATE THE NUMBER OF PETITION SIGNATORIES IN THE 3RD PARAGRAPH | |
* INSERT YOUR NAME AT THE END | |
Dear PICK ONE: Prime Minister / Mr Speaker / Minister / Assistant Minister / Madam / Sir | |
I am writing to you as my local representative in the federal parliament’s House of Representatives. | |
Very soon a petition will come before the House; Petition EN1041 - Declare a Climate Emergency. At the time of writing, this petition has over 147,000 signatories. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here is a letter I just wrote to my local MP about child abuse in detention centres. | |
I encourage you to also write to your MP. Feel free to copy my letter and insert the appropriate names at the top and bottom. | |
Email your local MP easily at: https://www.getup.org.au/campaigns/refugees/speak-up-for-kids-in-detention/write-to-your-mp | |
~~~~~~~~~~ | |
<Local Member's Name>, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here's how I currently think about messages and events. | |
A message is a simply piece of data passed from one place to another. | |
Messages come in two flavours: commands and events. | |
A command is a message sent by a sender when it wants to instruct another component to perform some task. | |
* The message is sent one-to-one / point-to-point. It is destined for one receiver. | |
* The sender knows (at least) the name of the receiver. | |
* The sender knows something of the domain of the receiver, as it chooses to send the command. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TestTimeTracer { | |
public static final int MILLIS_PER_NANO = 1000000; | |
private final Stack<Pair<String, Integer>> traceCounts = new Stack<>(); | |
private final NumberFormat numberFormat = NumberFormat.getIntegerInstance(); | |
private String methodName = null; | |
private int methodTraceCount = 0; | |
private int lastStackDepth = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import rx.Observable; | |
import rx.Observable.OnSubscribe; | |
import rx.Subscriber; | |
import rx.functions.Action1; | |
import rx.functions.Func1; | |
import rx.functions.Func2; | |
import rx.observables.ConnectableObservable; | |
import java.util.ArrayList; | |
import java.util.List; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
if [[ $1 = "-?" ]]; then | |
echo "usage: $(basename $0) [pom_file ...]" >&2 | |
exit 2 | |
fi | |
function printParentPom() { | |
if xmlstarlet sel -T -N m=http://maven.apache.org/POM/4.0.0 -t -m /m:project/m:parent -v "concat(m:groupId,':',m:artifactId,':',m:version)" -n $1 | |
then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Reads all dependencies from a Maven project and then deletes them all from your local repository. | |
# | |
# You may want to do this if you want to remove <repository> tags from a POM and check that you can still | |
# access all the dependencies for the project from just the remaining repositories. | |
# | |
# This code is in the public domain and may be used in any way you see fit, with the following conditions: | |
# | |
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, |
NewerOlder