Skip to content

Instantly share code, notes, and snippets.

View GwynethLlewelyn's full-sized avatar
👩
Learning Go

Gwyneth Llewelyn GwynethLlewelyn

👩
Learning Go
View GitHub Profile
@GwynethLlewelyn
GwynethLlewelyn / go-testing-fs-readdir.go
Created March 6, 2023 18:37
How to walk through a directory in Go (using the 'modern' post-1.16 functionality)
// See this in action: https://go.dev/play/p/mA3RRGhyZRe
// Read more about it: https://bitfieldconsulting.com/golang/filesystems#generalising-the-file-counter (scroll down a bit)
//
// The following code excerpt is placed in the Public Domain (CC0) by Gwyneth Llewelyn (2023)
package main
import (
"fmt"
"io/fs"
@GwynethLlewelyn
GwynethLlewelyn / direct-messages.js.md
Created December 15, 2022 14:01
Convert Twitter JSON direct messages to an easier format

Suppose you need to do a copy & paste of a conversation you had on Twitter to send it by email. Unfortunately, it's very hard to copy & paste it in toto from either the app or the web. Twitter makes it as hard as possible to do so, especially if you wish the whole conversation.

Conversations are conveniently stored as JSON files, but... you need to get access to them. One possible way to do so is the following:

  1. Ask Twitter for a link to an archive of all your data to be downloaded (they'll take up to 24 hours to provide you with it)
  2. Make sure jq is installed
  3. "862741-8538292" represents a conversation between two Twitter IDs (recipientId)
  4. You may have to massage the first line of direct-messages.js so that it reads
@GwynethLlewelyn
GwynethLlewelyn / date2exifdate.sh
Created November 19, 2022 18:36
Shell script to change the modification date of a PSD file to the EXIF data within
# !/bin/sh
#
# date2exifdate shell script
# (tested on bash only)
# (c) 2022 by Gwyneth Llewelyn. Most rights reserved.
#
# Licensed under a MIT License (see https://gwyneth-llewelyn.mit-license.org/)
#
#
# Purpose: Change the modification date of a PSD file to the EXIF data within
@GwynethLlewelyn
GwynethLlewelyn / change-email-from-admin-address.php
Created September 21, 2022 14:13
WordPress plugin to Change Email From Admin Address
<?php
/*
Plugin Name: Change Email From Admin Address
Description: A way to get rid of email coming from the wrong address that will cause problems with spam filters.
Author: Clifford Paulick
Version: 1.0
Author URI: https://wpmudev.com/blog/wordpress-email-settings/
*/
/*
@GwynethLlewelyn
GwynethLlewelyn / m4atomp3.sh
Last active March 1, 2025 21:19
Converts M4A to MP3 respecting the original bitrate (uses ffmpeg)
#!/usr/bin/env bash
# Takes a directory as parameter and converts everything inside it
# from M4A to MP3, respecting the bitrate, and creating a directory
# for the converted files.
#
# MIT Licensed by Gwyneth Llewelyn (2022)
#
# Based on https://superuser.com/a/1211902/127382 by @jbowman (2017)
@GwynethLlewelyn
GwynethLlewelyn / split-audio-with-ffmpeg-for-second-life.md
Last active June 8, 2022 16:17
Using ffmpeg to split audio files to the size expected by ffmpeg

Instructions on how to use ffmpeg

To split sounds for usage in Second Life.

  • Gwyneth Llewelyn (20220608)

Install ffmpeg and LAME

Your mileage may wary.

@GwynethLlewelyn
GwynethLlewelyn / nordbootstrap.css
Created March 26, 2022 03:08
Dark Nord Bootstrap 4 CSS
/*
This CSS contains a modified version of Bootstrap's CSS
Bootstrap's License can be found here: https://github.com/twbs/bootstrap/blob/main/LICENSE
This CSS contains the Nord color scheme made by Arctic Ice Studio & Sven Greb
Nord's License can be found here: https://github.com/arcticicestudio/nord/blob/develop/LICENSE.md
The modifications to Bootstrap's CSS were done by SaberTooth Studios Games
The github repository containing the source code of this CSS can be found here: https://github.com/SaberTooth-Studios/NordTheme-Bootstrap/
@GwynethLlewelyn
GwynethLlewelyn / fa-golang.svg
Created November 20, 2021 13:26
Golang Logo by FontAwesome
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@GwynethLlewelyn
GwynethLlewelyn / functions.php
Last active May 27, 2021 01:25
Minimalistic code to add rel=canonical links on HTML header
<?php
/**
* Minimalistic code to add rel=canonical links on HTML header.
*
* No wish to install a full-blown SEO plugin just to get those rel=canonical links? That's fine!
* Just place the code below somewhere on your child's theme `functions.php` file.
* If you also wish to get a meta description tag in the header, uncomment the last few lines.
*
* @todo this only works for singulars (page, post, attachment page, etc.); not for archive/search pseudo-pages,
which do *not* have a unique identifier at the $wp_query level... that's (mostly) why SEO plugins include
@GwynethLlewelyn
GwynethLlewelyn / Nord.spTheme
Created May 4, 2021 18:42
Nord theme for Sequel Ace
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>settings</key>
<array>
<dict>
<key>settings</key>
<dict>
<key>background</key>