Skip to content

Instantly share code, notes, and snippets.

View geoffreyvanwyk's full-sized avatar

Geoffrey van Wyk geoffreyvanwyk

View GitHub Profile
@kazqvaizer
kazqvaizer / multipartify.py
Last active January 31, 2025 09:31
Python dict to multipart/form-data converter to use it requests
"""
Here is a way to flatten python dictionaries for making multipart/form-data POST requests.
{"some": ["balls", "toys"], "field": "value", "nested": {"objects": "here"}}
->
{"some[0]": "balls", "some[1]": "toys", "field": "value", "nested[objects]": "here"}
@coltenkrauter
coltenkrauter / fix-wsl2-dns-resolution.md
Last active May 12, 2025 10:36
Fix DNS resolution in WSL2

Permanent WSL DNS Fix (WSL 2.2.1+)

If you're encountering ping github.com failing inside WSL with a Temporary failure in name resolution, you're not alone — this has been a long-standing issue, especially when using VPNs or corporate networks.

This issue is now fixed robustly with DNS tunneling, which preserves dynamic DNS behavior and avoids limitations like WSL’s former hard cap of 3 DNS servers in /etc/resolv.conf.

DNS tunneling is enabled by default in WSL version 2.2.1 and later, meaning that if you're still seeing DNS resolution issues, the first and most effective fix is simply to upgrade WSL. Upgrading WSL updates the WSL platform itself, but does not affect your installed Linux distributions, apps, or files.

To upgrade WSL, follow these steps,

@davialexandre
davialexandre / gruvbox_dark.json
Created June 23, 2019 18:09
Gruvbox Dark color scheme for the new Windows Terminal
{
"background" : "#282828",
"black" : "#282828",
"blue" : "#458588",
"brightBlack" : "#928374",
"brightBlue" : "#83A598",
"brightCyan" : "#8EC07C",
"brightGreen" : "#B8BB26",
"brightPurple" : "#D3869B",
"brightRed" : "#FB4934",
@jacksonpradolima
jacksonpradolima / install_source-pro_font.sh
Last active January 15, 2025 23:29
Installing Adobe's Source Pro fonts in Ubuntu: Source Code Pro, Source Serif Prof, and Source Sans Pro
#!/bin/bash
mkdir /tmp/adodefont
cd /tmp/adodefont
mkdir -p ~/.fonts
wget https://github.com/adobe-fonts/source-code-pro/archive/2.030R-ro/1.050R-it.zip
unzip 1.050R-it.zip
cp source-code-pro-2.030R-ro-1.050R-it/OTF/*.otf ~/.fonts/
wget https://github.com/adobe-fonts/source-serif-pro/archive/2.000R.zip
@matthewjberger
matthewjberger / instructions.md
Last active May 16, 2025 08:44
Install a nerd font on ubuntu

1.) Download a Nerd Font

2.) Unzip and copy to ~/.fonts

3.) Run the command fc-cache -fv to manually rebuild the font cache

# Usage:
# 1) Ctr+S downloads page to ~/Desktop/books.html
# 2) Run script
# 3) Find your books in /tmp/humble_books
# 4) Read them
# 5) Profit
cat ~/Desktop/books.html |
grep "https://dl.humble.com" |
sed -n -E 's/.data-web\=\"(https://dl.humble.com/([.]+).([a-z]+)?["]+)./\1 \2 \3/p' |
sed 's/&/&/g' > /tmp/humble_books_list && cat /tmp/humble_books_list |
@odan
odan / xampp_php7_xdebug.md
Last active April 9, 2025 13:07
Installing Xdebug for XAMPP
@marek-pietrzak-tg
marek-pietrzak-tg / runPhantomjs.sh
Created December 9, 2014 20:53
Runs PhantomJs in background
#!/bin/bash
echo "Running PhantomJs..."
LOGFILE=/tmp/phantomjs.log
exec 6>&1 # Link file descriptor #6 with stdout.
exec > $LOGFILE # stdout replaced with file "logfile.txt".
# ----------------------------------------------------------- #
@ryanbaldwin
ryanbaldwin / user_validator_test.clj
Last active August 29, 2015 14:10
The full hipstr.test.validators.user-validator-test namespace
(ns hipstr.test.validators.user-validator-test
(:require [hipstr.validators.user-validator :as uv])
(:use clojure.test))
(defn validate-email [email]
"Validates the provided email for us, and returns the
set of validation messages for the email, if any."
(:email (uv/email-validator {:email email})))
(defn validate-username [username]
@nolanlawson
nolanlawson / offline-first-tools.md
Last active September 18, 2024 23:24
List of offline-first tools for web developers

Offline-first tools for web developers

A quick list of tools for building HTML/CSS/JS apps that work well offline. Ping me at @nolanlawson if I missed anything!

Hybrid app development

Tools for bundling your HTML/CSS/JS into a native app.