Skip to content

Instantly share code, notes, and snippets.

View heatxsink's full-sized avatar
👽
They exist.

Nick Granado heatxsink

👽
They exist.
View GitHub Profile
@myfonj
myfonj / 0_html-sandbox-2.0.2.datauri.txt
Last active May 7, 2024 07:57
HTML sandbox - editor in data URI (890 bytes v1, 1165 v2), with live preview and persistence.
data:text/html;charset=utf-8;verbatim,<!doctype html><title>HTML sandbox 2.0.2</title><meta name=color-scheme content="dark light"><meta name=viewport content=width=device-width,initial-scale=1><body style=margin:0;display:flex;height:100vh onload="OT=(DC=document).title,A.value=decodeURIComponent((L=location).hash.slice(1)||'')||A.value;T=W=0;E=RegExp('^'+(D='data:text/html;charset=utf-8,'));F=()=>{if(W!=(V=A.value))W=V,M=V.match(/(^data:.+?(;verbatim)?,)?([^]*)/),I.src=M[2]?V:(M[1]||D)+encodeURIComponent(M[3]),DC.title=NT=((TM=V.match(/<title\b[^]*?\x3E([^]*?)<\/title\b/m))&&(NT=TM[1])&&(NT=NT.trim())&&(DC.title=NT+' @ '+OT))||OT};F()"><textarea autocapitalize=off style=resize:horizontal;width:50vw;border:inset autofocus id=A onkeyup=clearTimeout(T);T=setTimeout(F,400) onblur=try{history.pushState({},NT,'\u0023'+(S=I.src.replace(E,'')))}catch(e){L.hash=S}><!doctype html><html lang="en"><title>%0A%0A</title><meta name="color-scheme" content="dark light">%0A<meta name="viewport" content="width=device-width, i
@madebyollin
madebyollin / make_audiobook.py
Last active March 23, 2024 17:17
Converts an epub or text file to audiobook via Google Cloud TTS
#!/usr/bin/env python3
"""
To use:
1. install/set-up the google cloud api and dependencies listed on https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/texttospeech/cloud-client
2. install pandoc and pypandoc, also tqdm
3. create and download a service_account.json ("Service account key") from https://console.cloud.google.com/apis/credentials
4. run GOOGLE_APPLICATION_CREDENTIALS=service_account.json python make_audiobook.py book_name.epub
"""
import re
import sys
@CraigChilds94
CraigChilds94 / main.go
Last active May 1, 2023 21:19
GORM Example
import (
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/sqlite"
"encoding/json"
"fmt"
)
// The model.
type User struct {
gorm.Model
@celeryclub
celeryclub / Setting up headless Raspberry Pi OS on macOS.md
Last active May 2, 2024 02:21
Setting up headless Raspberry Pi OS on macOS

Download the latest Raspberry Pi OS Lite image from https://www.raspberrypi.com/software/operating-systems/ (2022-04-04 at the time of this writing).

Insert your microSD card. Use Raspberry Pi Imager to burn the image to your microSD card. Make to select "Set username and password" in the config before starting. Name the user pi and select your own password.

Ensure the disk is mounted again, then enable SSH.

$ touch /Volumes/boot/ssh