Skip to content

Instantly share code, notes, and snippets.

View tvjames's full-sized avatar
🇦🇺

Thomas James tvjames

🇦🇺
View GitHub Profile
@larenelg
larenelg / README.md
Last active October 11, 2019 05:06
Brisbane Tech Meetup Code of Conduct

Script for organisers to say during the welcome / kickoff for a meetup:

"A reminder that this Meetup is a respectful community of professionals with a code of conduct. Our meetup's code of conduct is available on our Meetup page."

Brisbane Tech Meetup Code of Conduct

This meetup is dedicated to providing a respectful, harassment-free community for everyone. We do not tolerate harassment or bullying of any community member in any form. This does not only extend to members to local meetup communities, but to anyone who chooses to become involved in the larger meetup community of users, developers and integrators through events or interactions.

Harassment includes offensive verbal/electronic comments related to personal characteristics or choices, sexual images or comments in public or online spaces, deliberate intimidation, bullying, stalking, following, harassing photography or recording, sustained disruption of talks, IRC chats, electronic meetings, physical meetings or other events, inappropriate physi

@swlaschin
swlaschin / effective-fsharp.md
Last active September 15, 2024 14:41
Effective F#, tips and tricks

Architecture

  • Use Onion architecture

    • Dependencies go inwards. That is, the Core domain doesn't know about outside layers
  • Use pipeline model to implement workflows/use-cases/stories

    • Business logic makes decisions
    • IO does storage with minimal logic
    • Keep Business logic and IO separate
  • Keep IO at edges

@samsch
samsch / stop-using-jwts.md
Last active September 14, 2024 08:21
Stop using JWTs

Stop using JWTs!

TLDR: JWTs should not be used for keeping your user logged in. They are not designed for this purpose, they are not secure, and there is a much better tool which is designed for it: regular cookie sessions.

If you've got a bit of time to watch a presentation on it, I highly recommend this talk: https://www.youtube.com/watch?v=pYeekwv3vC4 (Note that other topics are largely skimmed over, such as CSRF protection. You should learn about other topics from other sources. Also note that "valid" usecases for JWTs at the end of the video can also be easily handled by other, better, and more secure tools. Specifically, PASETO.)

A related topic: Don't use localStorage (or sessionStorage) for authentication credentials, including JWT tokens: https://www.rdegges.com/2018/please-stop-using-local-storage/

The reason to avoid JWTs comes down to a couple different points:

  • The JWT specification is specifically designed only for very short-live tokens (~5 minute or less). Sessions
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active September 20, 2024 19:47 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Exporting your 2FA tokens from Authy to transfer them into another 2FA application

IMPORTANT - Update regarding deprecation of Authy desktop apps

Past August 2024, Authy stopped supported the desktop version of their apps:
See Authy is shutting down its desktop app | The 2FA app Authy will only be available on Android and iOS starting in August for details.

And indeed, after a while, Authy changed something in their backend which now prevents the old desktop app from logging in. If you are already logged in, then you are in luck, and you can follow the instructions below to export to tokens.

If you are not logged in anymore, but can find a backup of the necessary files, then restore those files, and re-install Authy 2.2.3 following the instructions below, and it should work as expected.

@mihow
mihow / load_dotenv.sh
Last active September 16, 2024 17:00
Load environment variables from dotenv / .env file in Bash
# The initial version
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
# My favorite from the comments. Thanks @richarddewit & others!
set -a && source .env && set +a
@parmentf
parmentf / GitCommitEmoji.md
Last active September 19, 2024 17:12
Git Commit message Emoji
@aembleton
aembleton / docx2md.md
Last active May 17, 2023 07:04 — forked from vdavez/docx2md.md
Convert a Word Document into MD

Converting a Word Document to Markdown in One Move

The Problem

A lot of important government documents are created and saved in Microsoft Word (*.docx). But Microsoft Word is a proprietary format, and it's not really useful for presenting documents on the web. So, I wanted to find a way to convert a .docx file into markdown.

Installing Pandoc

On a mac you can use homebrew by running the command brew install pandoc.

The Solution

@prwhite
prwhite / Makefile
Last active September 19, 2024 17:21
Add a help target to a Makefile that will allow all targets to be self documenting
# Add the following 'help' target to your Makefile
# And add help text after each target name starting with '\#\#'
help: ## Show this help.
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
# Everything below is an example
target00: ## This message will show up when typing 'make help'
@echo does nothing

This is a work-in-progress script that automatically:

  1. Downloads the Tentacle MSI
  2. Installs it
  3. Installs and configures a Tentacle instance
  4. Registers the Tentacle with an Octopus server in "polling" mode

Remember to replace the settings at the bottom.

The script works great on EC2 as well. When creating a machine in EC2, paste the script between `` tags into the User Data section (in the EC2 management console, this is on the Configuration tab when creating a machine).