Skip to content

Instantly share code, notes, and snippets.

View djsnipa1's full-sized avatar
💾
codin’

Chad Boyce djsnipa1

💾
codin’
  • 17:08 (UTC -04:00)
View GitHub Profile
@davidteren
davidteren / nerd_fonts.md
Last active April 26, 2024 21:46
Install Nerd Fonts via Homebrew [updated & fixed]
@webdev23
webdev23 / 💾RePack
Last active March 16, 2024 07:19
💾RePack bookmarklet. Dump static page in one html file, highlight contents, embed styles, convert images as data-uri, remove scripts.
// Bookmarklet
javascript:void (()=>{let e="";try{document.designMode="on",onmouseup=()=>{document.execCommand("backColor",!1,"chartreuse"),window.getSelection().removeAllRanges()};var n=/^\s*('|")/;[...document.styleSheets].forEach((t=>{[...t.rules].forEach((t=>{var o,c;e+=(o=t.cssText,c=function(e){var n;(n=e,fetch(n).then((e=>e.blob())).then((e=>new Promise(((n,t)=>{const o=new FileReader;o.onloadend=()=>n(o.result),o.onerror=console.log(n,t),o.readAsDataURL(e)}))))).then((e=>{console.log("RESULT:",e)}))},[/(@import\s+)(')(.+?)(')/gi,/(@import\s+)(")(.+?)(")/gi,/(url\s*\()(\s*')([^']+?)(')/gi,/(url\s*\()(\s*")([^"]+?)(")/gi,/(url\s*\()(\s*)([^\s'")].*?)(\s*\))/gi].reduce((function(e,t,o){return e.replace(t,(function(e,t,o,r,s){var a=c(r);return console.log(t,o,a,s),n.test(a)&&n.test(o)&&(o=s=""),t+o+a+s}))}),o))}))})),[...document.querySelectorAll("link")].forEach((e=>{e.outerHTML=""})),[...document.querySelectorAll("source")].forEach((e=>{var n;(n=e.src,fetch(n).then((e=>e.blob())).then((e=>new Promise(((
// The bookmarklet does a couple things:
// If the current page in the browser is a YouTube page, it will open that video in `invidious.xyz`
// If the current page in the browser is _not_ a YouTube page, it will open the `invidious.xyz` homepage
//
// To use: Copy/Paste the code below into the bookmark's address:
javascript:location.hostname.includes("youtube.com")?location.assign("https://invidious.xyz"+location.pathname+location.search+location.hash):location.assign("https://invidious.xyz");
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: deep-green; icon-glyph: headphones-alt;
/*
* Best Looking Spotify Now Playing Widget
* Author: Brian Reich / reichman2
* Version: 1.0
* Contact: brianreich1223@gmail.com
*
@m-radzikowski
m-radzikowski / script-template.sh
Last active May 4, 2024 04:13
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
#!/bin/bash
# sudo apt install jq wget curl
# usage: github-install user/repo
set -e
repo=$1
tmp="/tmp/.github-install"
binpath="$HOME/.local/bin"
rm -rf $tmp
@marco79cgn
marco79cgn / bbc2-playlist.js
Last active August 28, 2023 21:02
A custom iOS widget that shows the last 5 songs from BBC2 radio and plays them in Spotify (for Scriptable.app)
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: red; icon-glyph: music;
// insert your Spotify client id and secret here
const clientId = "xxx"
const clientSecret = "xxx"
let widget = new ListWidget()
widget.setPadding(22,10,10,10)
@marco79cgn
marco79cgn / spotify-whats-new.js
Created October 2, 2020 14:42
A Scriptable widget that shows what's new on Spotify
// insert your Spotify client id and secret here
const clientId = "xxx"
const clientSecret = "xxx"
// the Spotify country ISO code
const spotifyCountry = "DE"
let widget = await createWidget()
Script.setWidget(widget)
Script.complete()
@kevingoldsmith
kevingoldsmith / clean_wpimport_for_pelican.py
Created August 14, 2020 05:42
Clean up the markdown code created from pelican-import from wordpress including downloading and re-adding all the images
import argparse
import xml.etree.ElementTree as ET
from bs4 import BeautifulSoup
import urllib.request
from urllib.parse import urlparse
import os
import re
def get_downloads_from_img(img):
return_list = []