Skip to content

Instantly share code, notes, and snippets.

View zathurarc
# zathurarc
# dark mode!
set recolor true
# Hide statusbar
set guioptions none
# Swap <C-d> and d, and change half-down to full down
map [normal] d scroll full-down
@Ryan1729
Ryan1729 / mathjax.html
Last active Sep 21, 2020
Mathjax on textarea keyup
View mathjax.html
<!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 / README.md
Created Aug 8, 2020
An over-extended Programming Language analogy
View README.md

Java is premade "enterpise-grade" coffee that comes in a disposable metal can with a plastic spigot. Just heat and serve. Unfortunately the mixture is very weak, so there's a bunch of products designed for you to add to it, but you ultimately you still taste the Java underneath.

C++ is soda with lots of additives, that only comes in packages containg 6 assorted flavours, and many people don't like many of the flavours. Some people disagree on which flavours are gross. Hoever, the cans are recyclable, so that's why games use it. Unfortunately easy to cut yourself on the packaging as well.

Golang is a smaller, Plan9-flavoured, fewer ingredient, less water, version of Java. Still comes in a disposable can with a spigot.

Rust is Haskell-flavoured soda with fewer additives that only comes in one flavour, like normal, geez. The packaging is specially designed to prevent you from cutting yourself, unless you purposely remove certain parts. The packaging is also recyclable, but you need to drive to a specific plac

@Ryan1729
Ryan1729 / README.md
Last active Jul 1, 2020
The nuclear option for when a page does not have a dark mode
View README.md

Nuclear Dark Mode

Open the browser console and paste the contents of nuclearDarkMode.js inside it.

Known bugs

  • iframes apparently cannot have their styles set by the host page, and are instead removed entirely. Some pages have content in iframes.
  • pseudo-elements may still have bright background colors. Is there a reasonable way to fix this?
@Ryan1729
Ryan1729 / paste_at_the_bottom_of_world_gen.txt
Created May 15, 2020
A Dwarf fortress 0.47.04 worldgen preset with lots of volcanos
View paste_at_the_bottom_of_world_gen.txt
[WORLD_GEN]
[TITLE:VOLCANOS]
[DIM:129:129]
[EMBARK_POINTS:1504]
[END_YEAR:1050]
[BEAST_END_YEAR:200:80]
[REVEAL_ALL_HISTORY:1]
[CULL_HISTORICAL_FIGURES:0]
[ELEVATION:1:400:401:401]
[RAINFALL:0:100:200:200]
View README.md
  • i3.config should be named /home/$USER/.config/i3/config

  • i3status.config should be named /home/$USER/.config/i3status/config

@Ryan1729
Ryan1729 / configuration.nix
Last active May 3, 2020
First attempt at a NixOS config
View configuration.nix
{ config, pkgs, ... }:
{
nixpkgs.config.allowUnfree = true;
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
@Ryan1729
Ryan1729 / main.rs
Last active Apr 29, 2020
A toy program that uses two threads to test multi-threaded debugging
View main.rs
use std::thread;
use std::time::{Duration, Instant};
use std::sync::mpsc::channel;
fn main() {
let (in1, out1) = channel();
let (in2, out2) = channel();
thread::Builder::new()
.name("1st".into())
@Ryan1729
Ryan1729 / firefox-setup.sh
Last active May 2, 2020
alpine linux firefox box setup script
View firefox-setup.sh
# 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 Feb 16, 2020
a demonstration that glyph_brush 0.6.2 does not allow changing the alpha and the colour at the same time.
View opengl.rs
//! 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::*;