Skip to content

Instantly share code, notes, and snippets.

View emarref's full-sized avatar
Verified

Malcolm Fell emarref

Verified
View GitHub Profile
@emarref
emarref / labeler.yml
Created May 25, 2023 01:47
Nice releases
# .github/labeler.yml
# Match changes to files to apply a label
"@backend":
- apps/backend/**/*
"@frontend":
- apps/frontend/**/*
"@api":
- packages/api/**/*
"@infrastructure":
- terraform/**/*
@emarref
emarref / docker-compose.yaml
Created October 27, 2021 02:45
Home Assistant
version: '3'
services:
homeassistant:
container_name: homeassistant
image: "ghcr.io/home-assistant/raspberrypi4-homeassistant:stable"
volumes:
- $PWD/homeassistant:/config
- /etc/localtime:/etc/localtime:ro
@emarref
emarref / WorkerSubscriber.php
Last active January 10, 2021 21:32
Deliver failed Symfony messenger messages to Sentry
<?php declare(strict_types=1);
namespace App\Subscriber;
use Sentry\FlushableClientInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Messenger\Event\WorkerMessageFailedEvent;
use Symfony\Component\Messenger\Exception\HandlerFailedException;
class WorkerSubscriber implements EventSubscriberInterface
@emarref
emarref / anz-transactions.js
Last active December 24, 2019 01:20
Download ANZ credit card transactions into YNAB format
javascript:(() => {
const table = document.querySelector('.transactions-list');
if (null === table) {
alert('Could not find transactions table');
return;
}
const transactions = Array.from(table.querySelectorAll('.transaction-row'))
.filter(row => row.querySelector('.column-dr span') ? true : false)
.map(row => [
new Date(row.querySelector('.column-trandate').innerText).toLocaleDateString(),
@emarref
emarref / utc2nz
Created October 19, 2019 06:32
Shell script to convert a timestamp to NZ time
#!/usr/bin/env php
<?php
$originTimeZone = 'UTC';
$targetTimeZone = 'Pacific/Auckland';
////////////////////////
$timestamp = implode(' ', array_slice($_SERVER['argv'], 1));
$origin = new DateTimeZone($originTimeZone);
@emarref
emarref / DummyComponent.tsx
Created January 17, 2019 20:36
A dummy component to hilight IDE autocompletion
import React from 'react';
import { connect } from 'react-redux';
interface RootState {
dataFromRootState: string;
}
interface OwnProps {
manualOwnProp: string;
}
@emarref
emarref / Dockerfile
Created October 3, 2018 21:28
AMQP compile failure on PHP7.3
FROM php:rc-fpm
RUN apt-get update && apt-get install -y librabbitmq-dev
RUN pecl channel-update pecl.php.net
RUN pecl install amqp
RUN docker-php-ext-enable amqp
<?php
require_once './vendor/autoload.php';
//
// Create a token, configuring it with any headers and payload you need
//
$token = new Emarref\Jwt\Token();
$token->addClaim(new \Emarref\Jwt\Claim\Audience('http://www.google.com/'));
$token->addClaim(new \Emarref\Jwt\Claim\Subject('Me\You'));
@emarref
emarref / planterbox.stl
Created November 9, 2015 03:10
Planter box
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@emarref
emarref / id_rsa.pub
Created September 7, 2015 20:31
My public key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCxSRb97l7/zHziRakatVxAQc+RvjwmtmMTaEsakwmmXrv3sF8nOnpsgbm/LsrHDtPlycMzBz3wVLOLNhX3dXKyLkNfYom71k5agfK1qvGUYWi69OO+GsiSxDaJApLVfTcfEDF+paKEkPYfJqmbKcF6G6L77sTYeFyFIcPRxQWk+IkVQAa2PNT52twlaT78l6qux/Zf9kHSvNvQfQIMh2afg7d/hv7zHgdKEgFWXEJwACwIUMIROZAga+jm3nmGQrlS8EmccxYC+pZq8GAgNcd6edGD916aWD3CwWA3KuQBg/whgrDAEAZBDnxo/irFOQ4g3cKSaVFwbiCBih2SI9ySaGKZrCPuBOaiaKcmmLvzwUrwcanmBwsn8RSRJybOH3mxRfFAuyZ/2/TqY+Yf08GjUEHY25M1krYKkGEvFRJt6bWoXGN+ePp2AQhJSTa2JE/1yYoKKltjtMGvBEaV0DS1SbieaVmTXMbRwl7fqrHgYr6EcRSb5+bOONOCl5Ipn9fQWlQd3T7AEUHvEhnCLxR85a1RBX/y3KW1wOo5pqSCHqn/wzKfHFgO7VrDcoSokJa/hMT5rq3EtQ52ZxTJfjHgfEKVqIRbg4sE0D6qlL1GzudWG7TKqzms1l+lBNHIigZGTjjyXw232ZQNkMckYSCNOSBGz8GMOe4rYbDvqIjyFw== emarref@gmail.com