Skip to content

Instantly share code, notes, and snippets.

@Ryan1729
Ryan1729 / firefox-setup.sh
Last active May 2, 2020 22:05
alpine linux firefox box setup script
# This rest of this script assumes that you have recently installed alpine linux, and that you have already
# set up your own user account, and logged into it. Here's how you set up a user account if you would like to
# do that before continuing, (assumes you are logged in as root, and that you want to call your account "myuser").
# Parts of this section and the below ones are based on https://wiki.alpinelinux.org/wiki/Dwm
# adduser myuser
# apk add sudo nano
# You need to edit the /etc/sudoers file, to add a line for your user below the one for the root user in the
# "User priviledge specifications section". That is the lines should look someithing like:
# ##.
@Ryan1729
Ryan1729 / opengl.rs
Created February 16, 2020 02:40
a demonstration that glyph_brush 0.6.2 does not allow changing the alpha and the colour at the same time.
//! Example of glyph_brush usage with raw OpenGL.
//!
//! Uses instanced rendering with 1 vertex per glyph referencing a 1 byte per pixel texture.
//!
//! Controls
//! * Scroll to size text.
//! * Type to modify text.
//! * Resize window.
use gl::types::*;
@Ryan1729
Ryan1729 / alacritty.toml
Last active October 1, 2024 20:15
alacritty config
# goes in ~/.config/alacritty/alacritty.toml
[bell]
animation = "EaseOutQuad"
color = "0xffb937"
duration = 500
[colors.bright]
black = "0x666666"
blue = "0x0037ff"
@Ryan1729
Ryan1729 / prompt-to-run
Created December 19, 2019 15:49
prompt-to-run script that allows editing command before executing.
# example usage:
# $ prompt-to-run 'echo hi'
prompt_acc=''
read -p 'run `'"$1"'`
' -i "$1" -e prompt_acc
eval "$prompt_acc"
@Ryan1729
Ryan1729 / old_gold_hold.js
Last active October 20, 2019 09:00
Generating interesting variants on a classic Dr. Seuss poem with a quick and dirty script
//
// SO copy-pasta
//
function perm(xs) {
let ret = [];
for (let i = 0; i < xs.length; i = i + 1) {
let rest = perm(xs.slice(0, i).concat(xs.slice(i + 1)));
if(!rest.length) {
@Ryan1729
Ryan1729 / .bashrc
Last active May 18, 2020 04:24
dotfiles
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
be () {
source be-impl $@
}
@Ryan1729
Ryan1729 / template.html
Created August 28, 2019 04:31
Dark Background HTML List Template
<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><style type="text/css">body{
margin:40px auto;
max-width:650px;
line-height:1.6;
font-size:18px;
color:#888;
background-color:#111;
padding:0 10px
@Ryan1729
Ryan1729 / -ColourScheme.md
Last active July 21, 2025 02:11
Colour Scheme

Base colors

// purportedly colour-blind friendly colours
black:   '0x222222'
red:     '0xde4949'
green:   '0x30b06e'
yellow:  '0xffb937'
blue:    '0x3352e1'
magenta: '0x533354'
cyan:    '0x5a7d8b'

white: '0xeeeeee'

@Ryan1729
Ryan1729 / notes.md
Last active April 7, 2020 09:53
Theming Git-Gui on windows

As far as i can tell there is no way to change the theme of git-gui as packaged in git for windows without editing .tcl files.

When you use the Git GUI here context menu option, the .tcl files that are interpreted are those in C:\Users\USERNAME\AppData\Local\Programs\Git\mingw64\lib\tk8.6\ttk. You can confirm this with Process Monitor. You'll want to filter for wish.exe if you do so. Oddly enough there is a totally separte copy of these files in Program Files/Git.

Hello world

A .tcl file that git-gui interprets directly is ttk.tcl. To demonstrate that this is the case add the following line ttk.tcl somewhere at the top level.

tk_messageBox -type ok -icon info -message "Hello world" -title "Info"
@Ryan1729
Ryan1729 / Add Alacritty to Context Menu.reg
Created November 25, 2018 22:46
A .reg file adding a call to a command, (in this case alacritty.exe) to the windows explorer context menu and passing it the current directory
Windows Registry Editor Version 5.00
; created by Ryan Wiedemann
;
; right-clicking directly on a directory
;
[HKEY_CLASSES_ROOT\Directory\shell\alacrittymenu]
@="Open Alacritty Here"