Skip to content

Instantly share code, notes, and snippets.

@etelford
etelford / .php-cs-fixer.php
Created July 19, 2022 19:43 — forked from laravel-shift/.php-cs-fixer.php
PHP CS Fixer - Laravel Coding Style Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
'default' => 'single_space',

Raspberry Pi, Static HTTPS site with Docker and Nginx

This tutorial is dated Oct 2021, if it's much further on than that this information might be out of date.

This is a guide on setting up a static HTTPS website on your raspberry pi using docker and nginx. The aim is to have this running on the raspberry pi and to be able to access it from a host computer on the same local network. You should already be able to ssh into your pi from your host computer and have raspberry pi OS set up.

Find your raspberry pi

@etelford
etelford / VortexRace3ForMac.md
Created May 12, 2021 23:25 — forked from arogulin/VortexRace3ForMac.md
How to setup Vortex Race 3 keyboard for Mac and move Fn key to Home

How to setup Vortex Race 3 for Mac with latest (on 2020-01-05) firmare V1.02.05.

For better understanding we will use the following naming convention:

  [ L1 ][ L2 ][ L3 ][ Space ][ R1 ][ R2 ][ R3 ]
  1. Reset everything by pressing L3+R1 for 5 seconds. Left LED will blink white color while you're holding the keys. Release them after it stopeed blinking.
  2. Get into one of the programmable layers (R2+RShift) – I like red, the super bright laser LED is the least super annoying in red.
  3. Put the keyboard in Windows Mode (Pn+W), it's the least problematic one.
@etelford
etelford / alignments.coffee
Created October 5, 2020 13:51 — forked from devongovett/alignments.coffee
PDFKit Examples part 2
lorem = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed pulvinar diam eu ' +
'dolor bibendum et varius diam laoreet. Morbi eget rutrum enim. Sed enim ipsum, ' +
'posuere nec hendrerit non, commodo quis tortor. Fusce id nisl augue. Fusce at ' +
'lectus ut libero vehicula imperdiet.'
doc.text 'This text is left aligned. ' + lorem, 100, 100,
width: 410
align: 'left'
doc.moveDown()
@etelford
etelford / export-cognito-users.sh
Created April 3, 2020 15:02 — forked from chrisdiana/export-cognito-users.sh
Export AWS Cognito User Pool
# Export as Text Table
aws --region XXXXXXXXX cognito-idp list-users --user-pool-id XXXXXXXXXXXXX --output table > ~/users.txt
# Export as JSON
aws --region XXXXXXXXX cognito-idp list-users --user-pool-id XXXXXXXXXXXXX --output json > ~/users.json
# Export User Pool with more than 60 users (pagination)
aws --region XXXXXXXXX cognito-idp list-users --user-pool-id XXXXXXXXXXXXX --pagination-token INCREDIBLYLONGSTRINGHERE --output json > ~/users-2.json
@etelford
etelford / ios_record_audio_to_file.swift
Created May 31, 2019 13:06
iOS: Recording audio from the mic & saving it to a file
// Recording audio to a file:
var engine = AVAudioEngine()
var distortion = AVAudioUnitDistortion()
var reverb = AVAudioUnitReverb()
var audioBuffer = AVAudioPCMBuffer()
var outputFile = AVAudioFile()
var delay = AVAudioUnitDelay()
func initializeAudioEngine() {
engine.stop()
https://github.com/jakubroztocil/httpie
export FIRE='Authorization:Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI'
http -v PUT :8000/profile "$FIRE" email=bob@aol.com avatar=http://google.com age=33