Skip to content

Instantly share code, notes, and snippets.

View danielmorgan's full-sized avatar

Daniel Morgan danielmorgan

View GitHub Profile
@danielmorgan
danielmorgan / portforward.ps1
Last active June 16, 2025 10:58
Powershell (admin) to forward WSL2 ports
wsl hostname -I
netsh interface portproxy add v4tov4 listenport=8081 listenaddress=0.0.0.0 connectport=8081 connectaddress=172.29.71.92
@danielmorgan
danielmorgan / .eslintrc.js
Last active March 8, 2025 12:15
Expo prettier/eslint setup
module.exports = {
extends: ["expo", "prettier"],
plugins: ["prettier"],
rules: {
"prettier/prettier": "error",
},
};
* {
border: 1px solid green;
}
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"color_scheme": "Packages/Materialize/schemes/Material Behave.tmTheme",
"theme": "Material Behave.sublime-theme",
"font_size": 12,
"ignored_packages":
[
"Vintage"
],
@danielmorgan
danielmorgan / danielmorgan-cmder.xml
Last active February 20, 2019 12:24
cmder config export
<?xml version="1.0" encoding="utf-8"?>
<key name="Software">
<key name="ConEmu">
<key name=".Vanilla" modified="2019-02-20 12:12:50" build="180626">
<value name="Language" type="string" data="en"/>
<value name="StartType" type="hex" data="03"/>
<value name="CmdLine" type="string" data=""/>
<value name="StartTasksFile" type="string" data=""/>
<value name="StartTasksName" type="string" data="{zsh::ubuntu}"/>
<value name="StartFarFolders" type="hex" data="00"/>
@danielmorgan
danielmorgan / gist:b39a7794d668e0a33e024fb96dc2d28a
Last active May 31, 2018 14:52
Centralised GDPR tool braindump

Problem

Accessing records is non-trivial. PII is stored across various services an organisation operates. These might have been built internally, or by external agencies. They may have a high bus factor, and it can be hard for someone new to figure out what data it stores, let alone query it. Auditing all your data and developing workflows for querying it can involve many people within multiple companies and potentially dozens of man-hours for a single Subject Access Request.

Deleting records can be difficult because of foreign key constraints. Blanking out data can be a way to work this in existing services, but new services will need to be designed with Subject Removal Requests in mind.

Proposed solution

   Server webapp
@danielmorgan
danielmorgan / gist:d51fa3cddec8d1eeb3d23894c4291970
Created August 25, 2017 15:02
Rename all photos sequentially (a = starting number)
#/bin/bash
a=0
for i in *.JPG; do
new=$(printf "%04d.jpg" "$a")
mv -i -- "$i" "$new"
let a=a+1
done
@danielmorgan
danielmorgan / gist:088eb950995963acd13041a0c6acba41
Created August 25, 2017 15:01
Resize and compress all images in working dir
mogrify -resize 1200x1200\> -define jpeg:extent=250kb *.jpg
<?php
//...
/** @test */
function user_cannot_view_all_clubs()
{
$this->actingAs($this->mockUser());
$response = $this->get('/admin/clubs');
@danielmorgan
danielmorgan / RouteServiceProvider.php
Last active January 25, 2017 09:06
Move auth routes to userland code in Laravel 5.3
# app/providers/RouteServiceProvider.php
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider