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 September 18, 2023 14:16
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
Last active May 6, 2024 14:11
Fix DNS resolution in WSL2
More recent resolution:
1. cd ~/../../etc (go to etc folder in WSL).
2. echo "[network]" | sudo tee wsl.conf (Create wsl.conf file and add the first line).
3. echo "generateResolvConf = false" | sudo tee -a wsl.conf (Append wsl.conf the next line).
4. wsl --terminate Debian (Terminate WSL in Windows cmd, in case is Ubuntu not Debian).
5. cd ~/../../etc (go to etc folder in WSL).
6. sudo rm -Rf resolv.conf (Delete the resolv.conf file).
7. In windows cmd, ps or terminal with the vpn connected do: Get-NetIPInterface or ipconfig /all for get the dns primary and
secondary.
@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 1, 2024 01:16
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 4, 2024 11:12
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 17, 2024 05:36
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 March 16, 2024 15:46
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.