Skip to content

Instantly share code, notes, and snippets.

Avatar

Raymond Li Raymo111

View GitHub Profile
@Raymo111
Raymo111 / CMakeLists.txt
Created Mar 29, 2022
CS 136 CMakeLists
View CMakeLists.txt
cmake_minimum_required(VERSION 3.16)
project(CS_136 C)
##################################################
set(ASSIGNMENT Final)
##################################################
find_package(LLVM REQUIRED CONFIG)
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
@Raymo111
Raymo111 / cs241-mips.xml
Last active Jan 27, 2022
CS 241 MIPS KSyntaxHighlighting
View cs241-mips.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<language name="CS 241 MIPS" version="1" kateversion="5.0" section="Assembler" extensions="*.asm;*.hex;" mimetype="text/x-mips" author="Raymond Li" priority="1">
<highlighting>
<list name="type">
<item>.word</item>
</list>
<list name="rinstr">
<item>add</item>
<item>sub</item>
@Raymo111
Raymo111 / Dark Reader pdf light mode.js
Created Jan 17, 2022
PDFium light mode for Dark Reader
View Dark Reader pdf light mode.js
let eee = "#eeeeee"
let sr = document.querySelector("#viewer").shadowRoot.querySelector("#toolbar").shadowRoot
sr.querySelector("#toolbar").style.backgroundColor = "lightgray"
sr.querySelector("#toolbar").style.color = "black"
let ce = sr.querySelector("#center").firstElementChild.shadowRoot
ce.querySelector("#pageselector").style.backgroundColor = eee
ce.querySelector("#pageselector").style.color = "black"
ce.querySelector("#divider").style.color = "black"
ce.querySelector("#pagelength").style.color = "black"
sr.querySelector("[aria-label='Zoom level']").style.backgroundColor = eee
@Raymo111
Raymo111 / csamarkup2tikz.py
Created Dec 2, 2021
Python script to convert CSAcademy Graph Editor Markup to TikZ
View csamarkup2tikz.py
import json
before = """\\begin{center}
\\begin{tikzpicture}[every node/.style={draw,circle,minimum size=25pt}]
\\begin{scope}[yscale=-1]
\\draw[thick]"""
after = """;
\\end{scope}
\\end{tikzpicture}
\\end{center}"""
View Konsole delete word.md

Konsole delete word

By Raymond Li (Raymo111) 29 August 2021

To map shortcuts like Ctrl+Bksp/Del to delete words backwards and forwards in Konsole:

  1. Go to Settings > Edit Current Profile... > Keyboard > Edit...`
  2. Edit (or add) the following key combos if they don't already exist:
Key Combination Output (Explanation)
Backspace-Ctrl \x7f Backspace without Ctrl should just delete the character before the cursor
Backspace+Ctrl \E\b Backspace with Ctrl should delete the word before the cursor. ^H should be encoded as \x08 (ascii control character code in hex) but Konsole converts that to \b, it's code for backspace.
View 1920x1080 HD webcam on Linux.md

1920x1080 HD webcam on Linux

By Raymond Li (Raymo111)

Last updated 8 Sept 2021

So your webcam is giving you a 5:4 low-res video and you can't do anything about it?

  1. Load the v4l2loopback kernel module:
sudo depmod -a
sudo modprobe v4l2loopback devices=1 max_buffers=2 exclusive_caps=1 card_label="VirtualCam"

You can do this persistently by creating a config file like video.conf in /etc/modprobe.d/ with the following in it:

@Raymo111
Raymo111 / pwrstatd-powerfail.sh
Last active Aug 21, 2021
UPS battery power notification
View pwrstatd-powerfail.sh
#!/bin/bash
#.
#.
#.
# (append this)
# Send a desktop notif
sudo -u raymo DISPLAY=:0 DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus notify-send "Warning: Utility power has failed. Now running on battery." -i battery-caution -u critical -t 10000 -h 'string:desktop-entry:ups' -a UPS
@Raymo111
Raymo111 / Raymond Li (Raymo111) (2021-02-01 4_18_15 PM).html
Created Feb 1, 2021
Personal website (snapshot at 2021-02-01 4:18:15 PM) to be sent to the moon thanks to u/Valphon
View Raymond Li (Raymo111) (2021-02-01 4_18_15 PM).html
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html class="desktop mbr-site-loaded" style>
<!--
Page saved with SingleFile
url: https://raymond.li/
saved date: Mon Feb 01 2021 16:18:15 GMT-0500 (Eastern Standard Time)
____ ____ _ ___ _____
/ ___| _ \| | / _ \ |___ /
| | _| |_) | | _____| | | | |_ \
@Raymo111
Raymo111 / keybase.md
Created Dec 2, 2020
Keybase proof of ownership
View keybase.md

Keybase proof

I hereby claim:

  • I am Raymo111 on github.
  • I am raymo111 (https://keybase.io/raymo111) on keybase.
  • I have a public key whose fingerprint is 64C2 FB18 E104 7522 9FFF 25D1 F058 DF98 2DB4 2F9D

To claim this, I am signing this object:

@Raymo111
Raymo111 / MSI Bravo A4DDR Arch Install.md
Last active Jan 5, 2022
How to install Arch Linux on an MSI Bravo A4DDR
View MSI Bravo A4DDR Arch Install.md

How to Install Arch Linux on an MSI Bravo A4DDR

By Raymo111

Last updated 29 July 2021

Disclaimer: I have personally tested every step of this. However, I'm not responsible for anything you do.

There's a Reddit thread for this laptop.

Pre-install

  1. Setup Windows.