Skip to content

Instantly share code, notes, and snippets.

@seakintruth
seakintruth / hb_all_books_dl.js
Last active December 1, 2017 06:02 — forked from kfatehi/hb_all_books_dl.js
Humble bundle book bundles - download all books at once
/*
After purchasing a humble book bundle, go to your download page for that bundle.
Open a console window for the page and paste in the below javascript
this fork downloads all formats and does so without using jquery (since that didnt work for me)
note that if you are in chrome, chrome will not download the pdfs for you by default, to fix this
Settings (chrome://settings) --> Advanced --> Privacy and security --> Content settings --> PDF documents --> Download PDF files instead of automatically opening them in Chrome --> Turn ON
Settings (chrome://settings) --> Advanced --> Downloads --> Ask where to save each file before downloading --> Turn OFF
*/
def extractDomain(data):
# Remove protocol part of url
data = re.sub(r"^http(s)?\x3a\x2f\x2f", "", str(data), flags=re.IGNORECASE)
# Remove part after FQDN
data = re.sub(r"\x2f(.*)$", "", str(data), flags=re.IGNORECASE)
# Remove port
data = re.sub(r"\x3a\d{1,}$", "", str(data), flags=re.IGNORECASE)
@seakintruth
seakintruth / ini.ps1
Last active June 23, 2023 04:55 — forked from beruic/ini.ps1
Read INI files in PowerShell
function Get-IniFile {
<#
.SYNOPSIS
Read an ini file.
.DESCRIPTION
Reads an ini file into a hash table of sections with keys and values.
.PARAMETER filePath
The path to the INI file.
@seakintruth
seakintruth / connector.scad
Created February 27, 2023 13:56 — forked from BarDweller/connector.scad
Configurable Tent pole coupler in OpenSCAD
// This is an example of connecting poles from
// https://gist.github.com/BarDweller/f467cb58f5c252efda60eaa6777309ca
poleradius = 9/2; //radius of pole
socketdepth = 15; //depth required for pole socket (note: not absolute due to ball join)
totalplugsize = 20; //exterior depth of pole corner
wallthick = 2; //thickness for walls
joinangle = 120; //angle to join two connectors at.
smoothness = 64; //number of faces for cylinder/sphere.