This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Enable URL rewriting | |
RewriteEngine On | |
# Force HTTPS redirect | |
RewriteCond %{HTTPS} off | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] | |
# Redirect ALL requests to the static directory | |
# Check if the requested file exists in /static/ first |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Parallel IA downloader - creates individual download commands for each file | |
and runs them concurrently using the ia command line tool. | |
USAGE: | |
First install the Internet Archive command line tool: | |
curl -LOs https://archive.org/download/ia-pex/ia | |
chmod +x ia | |
# install concurrent futures if not already installed for concurrent downloads |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json, re, pathlib | |
SMALL_KEYS = {"sm", "xs"} | |
def strip_small(obj): | |
if isinstance(obj, dict): | |
cleaned = {} | |
for k, v in obj.items(): | |
# nuke breakpoint keys | |
if k in SMALL_KEYS: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Clickable Transparency Library | |
* -------------------------------- | |
* This script enables non-transparent parts of an image to be clickable. | |
* It works for both <img> elements and any element with a background image. | |
* For any element with the "clickable-transparency" class: | |
* - It changes the mouse cursor to 'pointer' over non-transparent areas and 'default' over transparent areas. | |
* - It prevents click propagation if a transparent area is clicked. | |
* | |
* Usage: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
/** | |
* No-Scroll Script for Hype Documents | |
* Prevents vertical scrolling on HYPE_document elements | |
* while preserving other touch gestures | |
*/ | |
(function() { | |
// Store original touch positions | |
let startY; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// element - DOMHTMLElement that triggered this function being called | |
// event - event that triggered this function being called | |
function pinchablev2(hypeDocument, element, event) { | |
// if it's 'pinchable', let it resize outside of hype scene | |
// User configurable settings | |
var PINCHABLE_CONFIG = { | |
maxScale: 4, // Maximum zoom level | |
minScale: 1, // Minimum zoom level (enforced strictly) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# usage: | |
# python3 splitter.py database_name dbusername dbpassword | |
import sys | |
import os | |
import re | |
import logging | |
def main(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>PayloadContent</key> | |
<array> | |
<dict> | |
<key>DNSSettings</key> | |
<dict> | |
<key>DNSProtocol</key> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import vobject | |
import logging | |
from tqdm import tqdm | |
def minimize_vcf(input_file, output_file, fields_to_keep=None): | |
if fields_to_keep is None: | |
fields_to_keep = ['n', 'fn', 'tel', 'email', 'adr'] | |
fields_to_keep = [field.lower() for field in fields_to_keep] | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import http.server | |
import ssl | |
import socket | |
import os | |
import subprocess | |
HOST = f"{socket.gethostname()}" | |
PORT = 443 | |
CERT_FILE = 'self-signed.cert' | |
KEY_FILE = 'self-signed.key' |
NewerOlder