Skip to content

Instantly share code, notes, and snippets.

View emarref's full-sized avatar
Verified

Malcolm Fell emarref

Verified
View GitHub Profile

This helps to prevent PR spam, and avoids breaking changes in Typescript.

  • All major version updates get their own PRs
  • All security updates get their own PRs
  • TypeScript should always have its own PR, even for patch and minor versions (it doesn't follow SemVer)
  • Everything else (i.e. patch and minor version updates) should be grouped into a single PR to reduce PR spam
@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.