Skip to content

Instantly share code, notes, and snippets.

Avatar

James Doyle james2doyle

View GitHub Profile
@james2doyle
james2doyle / Canary Ortho.tfl
Last active March 31, 2023 19:54
Keyboard layouts for Apsu Canary and Wreathy that work on Type Fu https://type-fu.com/app
View Canary Ortho.tfl
{
"id": "custom-cc37d55a-4b1f-4a3c-9f49-6f3e0cd15520",
"name": "Canary (Ortho)",
"description": "https://github.com/Apsu/Canary#ortho",
"version": 1,
"keys": {
"Digit1": {
"default": {
"base": "1",
"shift": "!"
@james2doyle
james2doyle / postgresql-encrypt-decrypt.sql
Last active March 10, 2023 21:42
A Postgresql trigger and function to encrypt and decrypt a field
View postgresql-encrypt-decrypt.sql
CREATE OR REPLACE FUNCTION encrypt_field()
RETURNS TRIGGER
AS $func$
BEGIN
IF PGP_SYM_ENCRYPT(NEW.encrypted_field, 'the-password-here')::text != OLD.encrypted_field::text THEN
NEW.encrypted_field := PGP_SYM_ENCRYPT(NEW.encrypted_field, 'the-password-here')::text;
END IF;
RETURN NEW;
END
$func$
View cli-key-input.php
<?php
$mappings = [
82 => [
'key' => 'R',
'message' => 'Redownloading all pages...',
],
114 => [
'key' => 'r',
'message' => 'Redownloading all pages...',
View style.css
body {
margin:40px auto;
max-width:650px;
line-height:1.6;
font-size:18px;
color:#444;
padding:0 10px;
background: #EEE;
}
@james2doyle
james2doyle / next.sublime-project
Created February 23, 2023 21:40
A sublime project file for Next.js React code
View next.sublime-project
{
"folders": [
{
"file_exclude_patterns": [
".gitkeep",
"*.min.*",
"*.ts.snap",
"*lock*"
],
"folder_exclude_patterns": [
@james2doyle
james2doyle / bitbucket-pipelines.yml
Created February 14, 2023 21:38
Bitbucket pipeline file for building Android app apk files with Flutter
View bitbucket-pipelines.yml
# You can run the pipeline image locally using the following command:
# docker run --platform linux/amd64 -it --volume="$PWD:/app" --workdir="/app" --entrypoint=/bin/bash avetkhov/flutter:latest
definitions:
caches:
pub: ~/.pub-cache # $PUB_CACHE default value
flutter: /opt/flutter # flutter sdk path
steps:
- step: &flutter-run
name: Flutter Test
@james2doyle
james2doyle / flutter.sublime-build
Created January 25, 2023 18:56
Flutter Sublime Text 3 build helpers
View flutter.sublime-build
{
"cmd": ["flutter", "run", "--hot"],
"selector": "source.dart",
"working_dir": "$project_path",
"variants": [
{
"name": "Flutter - Format File",
"cmd": ["dart", "format", "$file"]
},
{
@james2doyle
james2doyle / flutter.sublime-project
Last active January 25, 2023 19:42
Flutter Sublime Text project file that includes some build system helpers
View flutter.sublime-project
{
"folders": [
{
"path": ".",
"folder_exclude_patterns": [
".dart_tool",
"build",
"web",
"windows",
"linux",
@james2doyle
james2doyle / docker-compose.yml
Created December 8, 2022 00:04
A docker compose file for payload CMS that includes a setup of inbound to catch emails
View docker-compose.yml
# `npx create-payload-app` with a project called `demo`
version: '3'
services:
payload:
image: node:18-alpine
ports:
- "3000:3000"
volumes:
- ./demo:/home/node/app
@james2doyle
james2doyle / docker-compose.yml
Last active December 19, 2022 21:03
Run inbucket locally in Docker to capture and debug emails without sending them
View docker-compose.yml
# docker run -d --name inbucket -p 9000:9000 -p 2500:2500 -p 1100:1100 inbucket/inbucket
# open http://localhost:9090/
version: '3.8'
services:
inbucket:
container_name: inbucket
image: inbucket/inbucket:3.0.3
ports:
- '2500:2500' # SMTP