Skip to content

Instantly share code, notes, and snippets.

View rsgranne's full-sized avatar

Scott Granneman rsgranne

View GitHub Profile
@OrionReed
OrionReed / dom3d.js
Last active May 4, 2024 19:48
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@gruber
gruber / Split Tabs to New Window.scpt
Last active April 16, 2024 20:52
An AppleScript for Safari to move all tabs in the frontmost window, from the current tab to the rightmost (last) tab, to a new window.
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
(*
Original script: John Gruber (https://daringfireball.net/linked/2023/12/05/an-applescript-for-safari-split-tabs-to-new-window)
Much more elegant version: Leon Cowle (https://github.com/leoncowle)
Even more elegant version: https://stackoverflow.com/questions/54066100/applescript-to-split-safari-tabs-into-new-window/54089865#54089865
Worth a warning: "moving" tabs with this script doesn't actually move them like
drag-and-drop does. The tabs "moved" by this script will reload in the new window,
@Julioevm
Julioevm / gist:68275ea1324046caedfdfb2ba0e9b710
Last active July 22, 2023 04:34
Kagi summarize bookmarklet
javascript:(
function() {
let currentUrl = encodeURIComponent(window.location.href);
window.open('https://kagi.com/summarizer/index.html?url=' + currentUrl + '&target_language=&summary=takeaway');
})();
@hyperupcall
hyperupcall / settings.jsonc
Last active May 3, 2024 12:52
VSCode config to disable popular extensions' annoyances (telemetry, notifications, welcome pages, etc.)
// I'm tired of extensions that automatically:
// - show welcome pages / walkthroughs
// - show release notes
// - send telemetry
// - recommend things
//
// This disables all of that stuff.
// If you have more config, leave a comment so I can add it!!
{
@llimllib
llimllib / install.sh
Last active April 11, 2024 21:07
The script I use to set up a new mac just the way I like it
#!/usr/bin/env bash
# many settings from https://raw.githubusercontent.com/mathiasbynens/dotfiles/master/.macos
# many settings from https://raw.githubusercontent.com/thoughtbot/laptop/master/mac
# instructions on finding the default you've changed: https://pawelgrzybek.com/change-macos-user-preferences-via-command-line/
# previous install notes at:
# https://gist.github.com/llimllib/ee591266e05bd880629a4e7511a61bb3
# https://gist.github.com/llimllib/e864a92da94ceb1ef0da2e06fd1f8d70
# https://gist.github.com/llimllib/3fc4fefcfc0152dad8c58201246d8802
#
# this script's URL is: https://gist.github.com/llimllib/c4dd0a98a426022b0365d4c0a9090460
@chockenberry
chockenberry / finder_icons.sh
Created March 16, 2023 20:00
Script to toggle Finder icons
#!/bin/sh
defaults read com.apple.finder CreateDesktop > /dev/null 2>&1
enabled=$?
if [ "$1" = "off" ]; then
if [ $enabled -eq 1 ]; then
osascript -e 'tell application "Finder" to quit'
defaults write com.apple.finder CreateDesktop false
open -a Finder
@selfire1
selfire1 / resize.scpt
Last active March 20, 2022 10:56
An Applescript to resize windows from the command line
on run argv
-- Variables
set _cmd to (item 1 of argv)
tell application "Finder" to set _bounds to bounds of window of desktop
set _xPos to (item 1 of _bounds)
set _yPos to (item 2 of _bounds)
set _ySize to (item 3 of _bounds)
set _xSize to (item 4 of _bounds)
-- get bounds
-- do split: app1, app2, set split
@rwcitek
rwcitek / chromebook.install.docker.sh
Last active April 17, 2023 04:54
Configure Linux and Install Docker on a Chromebook
# https://dvillalobos.github.io/2020/How-to-install-and-run-Docker-on-a-Chromebook/
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update --allow-releaseinfo-change
sudo apt-get -y install \
apt-transport-https \
ca-certificates \
curl \
@dannypage
dannypage / twitter_font_adblock.txt
Created August 24, 2021 21:44
How to block Twitter's terrible font
# Go to uBlock's options and paste in the following under the "My Filters" tab
https://abs.twimg.com/fonts/chirp-bold-web.woff
https://abs.twimg.com/fonts/chirp-heavy-web.woff
https://abs.twimg.com/fonts/chirp-regular-web.woff
https://abs.twimg.com/fonts/v2/chirp-bold-web.woff
https://abs.twimg.com/fonts/v2/chirp-heavy-web.woff
https://abs.twimg.com/fonts/v2/chirp-medium-web.woff
https://abs.twimg.com/fonts/v2/chirp-regular-web.woff