Skip to content

Instantly share code, notes, and snippets.

@ww9
ww9 / context_keys_as_struct_not_int_or_string.md
Last active May 8, 2024 04:27
Why use empty struct{} and not int or string for context.Value() key types in #go

Use struct{} as keys for context.Value() in Go

In the other file of this gist I detail why we should use struct{} as context.Value() keys and not int or string. Open gist to see main.go but the TLDR is:

	type key struct{}
	ctx = context.WithValue(ctx, key{}, "my value") // Set value
	myValue, ok := ctx.Value(key{}).(string) // Get value
@medwig
medwig / buildspec-terraform-symlinks.yml
Created April 23, 2019 13:29
Repair symlinks in AWS codepipeline
@soloidx
soloidx / 00_config_setup.sh
Created May 8, 2024 04:18
My macOS setup
#/usr/bin/env bash
set -x
if [ -f ~/.osx-configured.txt ]; then
cat << EOF
~/.osx-configured.txt FOUND!
Exiting. No changes were made.
EOF
exit 0
@denizssch
denizssch / XpSerials.txt
Created July 21, 2019 00:13
Windows XP ALL Serial Keys :) (For testing purpose [Ex: VM or PenTest])
FCKGW-RHQQ2-YXRKT-8TG6W-2B7Q8
Windows XP PRO Corporate serial number S/N: Key: MQPWW-PGVKX-YPMKG-8DH3G-KC8PW
windows xp home edition serial number S/N: 034634-262024-171505-828316-729010-413531-800424-400442
Windows XP 64 serial number S/N: B2RBK-7KPT9-4JP6X-QQFWM-PJD6G
Windows XP serial number S/N: K6C2K-KY62K-DQR84-RD4QV-QB74Q
Windows XP Professional 64-bit Corporate Edition 5.2.3790.1830 serial number S/N: VCFQD-V9FX9-46WVH-K3CD4-4J3JM
Microsoft Windows XP Professional SP2 serial number S/N: YY8F2-3CKVQ-RKTRG-6JMDR-9DTG6
Windows XP Professional Service Pack 1 sp1 serial number S/N: F46YY - 2R8VQ - R8GMY - 926VK - 6BQ73
Windows XP Pro serial number S/N: KBWR7-76BD8-J7MDQ-KKG&C-V9Q2J
@nickytonline
nickytonline / settings.jsonc
Created May 5, 2024 18:25
Latest VS Code Settings
{
// miscellaneous
"javascript.updateImportsOnFileMove.enabled": "always",
"typescript.updateImportsOnFileMove.enabled": "always",
"diffEditor.ignoreTrimWhitespace": false,
// window
"window.title": "🦙⚡🫡 – ${activeEditorShort}${separator}${rootName} – 🫡⚡🦙",
"window.clickThroughInactive": false,
@pastleo
pastleo / nm_l2tp_ipsec_vpn.md
Last active May 8, 2024 04:16
setup L2TP IPSEC VPN in archlinux using NetworkManager
@Joao-Peterson
Joao-Peterson / gmk67-manual.md
Last active May 8, 2024 04:15
GMK67 manual (English)
@BIGBALLON
BIGBALLON / extract_ILSVRC.sh
Created May 13, 2018 20:09
script for ImageNet data extract.
#!/bin/bash
#
# script to extract ImageNet dataset
# ILSVRC2012_img_train.tar (about 138 GB)
# ILSVRC2012_img_val.tar (about 6.3 GB)
# make sure ILSVRC2012_img_train.tar & ILSVRC2012_img_val.tar in your current directory
#
# https://github.com/facebook/fb.resnet.torch/blob/master/INSTALL.md
#
# train/