Skip to content

Instantly share code, notes, and snippets.

View leoherzog's full-sized avatar

Leo leoherzog

View GitHub Profile
@ImranR98
ImranR98 / eOSUDS.sh
Last active March 23, 2023 06:33
elementaryOS 6 has great dark themes, but they only apply to "curated" appcenter apps. This script forces the system theme to work with regular Debian packages as well as non-curated Flatpak apps. It also optionally changes the wallpaper based on the theme. It also supports changing themes for the Mailspring email app (both .deb and Snap versions).
#!/usr/bin/bash
# =======================================
# eOS-Universal-Dark-Style
# =======================================
# elementaryOS 6 has great dark themes, but they only apply to "curated" appcenter apps
# This script forces the system theme to work with regular Debian packages as well as non-curated Flatpak apps
# It also optionally changes the wallpaper based on the theme
@rcknr
rcknr / Code.gs
Last active March 13, 2024 21:49
MD5 Hash in Google Apps Script
function md5(inputString) {
return Utilities.computeDigest(Utilities.DigestAlgorithm.MD5, inputString)
.reduce((output, byte) => output + (byte & 255).toString(16).padStart(2, '0'), '');
}
@hazcod
hazcod / wgcf.sh
Created October 16, 2019 06:10
Connect to Cloudflare Warp from macOS.
#!/usr/bin/env bash
set -euo pipefail
shopt -s inherit_errexit 2>/dev/null || true
# this script will connect macOS to Cloudflare Warp using Wireguard
# note: this is *absolutely not* an official client from Cloudflare
# Copyright (C) 2019 Jay Freeman (saurik)
# Zero Clause BSD license {{{
@oskar456
oskar456 / wgcf.py
Last active February 17, 2024 12:47
Cloudflare WARP linux client (using wg-quick for actual tunnel setup)
#!/usr/bin/env python3
import subprocess
import json
import os
from pathlib import Path
import requests
from requests.compat import urljoin
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active April 10, 2024 20:23
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@munificent
munificent / generate.c
Last active March 18, 2024 08:31
A random dungeon generator that fits on a business card
#include <time.h> // Robert Nystrom
#include <stdio.h> // @munificentbob
#include <stdlib.h> // for Ginny
#define r return // 2008-2019
#define l(a, b, c, d) for (i y=a;y\
<b; y++) for (int x = c; x < d; x++)
typedef int i;const i H=40;const i W
=80;i m[40][80];i g(i x){r rand()%x;
}void cave(i s){i w=g(10)+5;i h=g(6)
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active April 26, 2024 16:33 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@agentsim
agentsim / highsierra_bootable.sh
Created June 10, 2017 02:23
Create bootable ISO from HighSierra Installer
# Generate a BaseSystem.dmg with 10.13 Install Packages
hdiutil attach /Applications/Install\ macOS\ 10.13\ Beta.app/Contents/SharedSupport/InstallESD.dmg -noverify -mountpoint /Volumes/highsierra
hdiutil create -o /tmp/HighSierraBase.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach /tmp/HighSierraBase.cdr.dmg -noverify -mountpoint /Volumes/install_build
asr restore -source /Applications/Install\ macOS\ 10.13\ Beta.app/Contents/SharedSupport/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
cp -R /Volumes/highsierra/Packages /Volumes/OS\ X\ Base\ System/System/Installation
hdiutil detach /Volumes/OS\ X\ Base\ System/
hdiutil detach /Volumes/highsierra/
mv /tmp/HighSierraBase.cdr.dmg /tmp/BaseSystem.dmg
@leoherzog
leoherzog / temp.js
Last active December 9, 2020 15:34
Wunderground Color Temperature Scale with Chroma.js
//<script src="//cdnjs.cloudflare.com/ajax/libs/chroma-js/1.3.3/chroma.min.js"></script>
function getColorFromTemp(tempInF) {
// establish the chroma 'scale' object
var tempScaleColors = ["#111111", "#21006B", "#4C006B", "#6B006B", "#990099", "#B300B3", "#CC00CC", "#E600E6", "#FF02FF", "#D100FF", "#9E01FF", "#6600FF", "#1800FF", "#144AFF", "#0E74FF", "#00A4FF", "#00CBFF", "#00E6FF", "#00FFFF", "#01FFB3", "#7FFF00", "#CEFF00", "#FEFF00", "#FFE601", "#FFCB00", "#FFAE00", "#FF9900", "#FE7F00", "#FF4F00", "#FF0700", "#FF4545", "#FF6968", "#FF8787", "#FF9E9E", "#FFB5B5", "#FFCFCF", "#FFE8E8", "#EEEEEE"];
var tempScale = chroma.scale(tempScaleColors).domain([-60,130]).mode('lab');
// extract color from chroma scale by giving it a temp number
var color = tempScale(tempInF);
return color;
}
@julianxhokaxhiu
julianxhokaxhiu / create-iso.sh
Created September 24, 2016 21:46
Simple bash script to create a Bootable ISO from macOS Sierra Install Image from Mac App Store
#!/bin/bash
#
# Credits to fuckbecauseican5 from https://www.reddit.com/r/hackintosh/comments/4s561a/macos_sierra_16a238m_install_success_and_guide/
# Adapted to work with the official image available into Mac App Store
#
# Enjoy!
hdiutil attach /Applications/Install\ macOS\ Sierra.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build