Skip to content

Instantly share code, notes, and snippets.

@MatthewLymer
MatthewLymer / .zshrc
Last active September 22, 2022 18:01
Shell prompt
#
# source material: https://dev.to/ahmettkartal/display-current-git-branch-on-iterm2-3ko8
#
COLOR_DEFAULT='%f'
COLOR_DIRECTORY='%F{197}'
COLOR_GIT='%F{39}'
COLOR_MODIFIED='%F{36}'
@MatthewLymer
MatthewLymer / yield-delay.js
Created April 13, 2021 16:02
async Yield and Delay implementations for JavaScript
function yield () {
return new Promise(resolve => setImmediate(() => resolve()));
}
function delay (milliseconds) {
return new Promise(resolve => setTimeout(() => resolve(), milliseconds));
}
@MatthewLymer
MatthewLymer / gpg-symmetric-example.sh
Last active April 14, 2020 18:11
Symmetric AES256 encryption and decryption with GPG
echo "Attack at dawn!" > secret-message-original.txt
echo "MyPassword" | gpg \
--output secret-message.txt.gpg \
--passphrase-fd 0 \
--batch \
--cipher-algo AES256 \
--symmetric secret-message-original.txt
echo "MyPassword" | gpg \
@MatthewLymer
MatthewLymer / HttpTests.cs
Created March 7, 2018 17:24
.NET Core send https request through proxy using sockets
using System.IO;
using System.Net;
using System.Net.Security;
using System.Net.Sockets;
using System.Security.Authentication;
using System.Text;
using System.Threading.Tasks;
using Xunit;
namespace Matthew.Lymer.Tests