Skip to content

Instantly share code, notes, and snippets.

View kj-sh604's full-sized avatar
💻
currently stuck in Vim

Kyle Javier [kj_sh604] kj-sh604

💻
currently stuck in Vim
View GitHub Profile
@kj-sh604
kj-sh604 / include.js
Created August 5, 2024 04:16
Creates an <include-html> tag for HTML partials. Works similarly to "include" and "require" in PHP.
// Example Usage in HTML:
// <include-html file="partials/fancy.html"></include-html>
class HTMLIncludeElement extends HTMLElement {
connectedCallback() {
const filepath = this.getAttribute('file');
if (filepath) {
fetch(filepath)
.then(response => {
if (!response.ok) {

🦊 Firefox "about:config" Flags That I Like 🔥

Here are some Firefox about:config flags that I have enabled. Most of these are for hardware video acceleration on Linux and personal "web viewing" preferences. Hope that some of you find them useful as well.

Hardware Video Acceleration for Linux

Option Value
gfx.webrender.all true
gl.require-hardware true
@kj-sh604
kj-sh604 / .screenrc
Last active July 19, 2024 17:52
GNU Screen Config (4.0.0 — 4.9.9)
attrcolor b ".I"
termcapinfo xterm 'Co#256:AB=\E[48;5;%dm:AF=\E[38;5;%dm'
defbce on
backtick 0 5 5 "/usr/bin/date" '+%m/%d (%a)'
backtick 1 5 5 "/usr/bin/date" '+%H%M'
hardstatus alwaysfirstline
hardstatus string '%{= kW}[%{W} GNU screen %{W}]%{W} %< %{kW}%?%-Lw%?%{= kB}(== %{W}%n*%f %t%?(%u)%? %{kB}==)%{= kW}%?%+Lw%?%? %= %{kW}[%{W}%0` %{W}%1`%{kW}]'
altscreen on
bind 0 select 10
bind c screen 1
@kj-sh604
kj-sh604 / web-servers.md
Created July 10, 2024 04:10 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@kj-sh604
kj-sh604 / dark-pastels.colors
Created June 24, 2024 10:10
color codes for the my version of the dark pastels terminal color scheme
background = #2c2c2c
foreground = #dcdcdc
# basic colors
black = #3f3f3f
red = #d67979
green = #60b48a
yellow = #dfaf8f
blue = #9ab8d7
magenta = #dc8cc3
@kj-sh604
kj-sh604 / xfce4-reset-dark-mode.sh
Last active June 12, 2024 16:06
start-up script to reset GNOME dark mode app color-scheme based on Xfce's settings
#!/bin/sh
theme_name=$(xfconf-query -c xsettings -p /Net/ThemeName)
if echo "$theme_name" | grep -- "-dark$" >/dev/null 2>&1; then
gsettings set org.gnome.desktop.interface color-scheme 'prefer-dark'
else
gsettings set org.gnome.desktop.interface color-scheme 'prefer-light'
fi
evdev:input:b*v046DpC548*
KEYBOARD_KEY_70065=print
@kj-sh604
kj-sh604 / 20-intel.conf
Last active February 29, 2024 05:54
personal Intel Graphics XF86/X11 configuration for my Thinkpad T480
# great grahics performance but causes rare X11 crashes for some reason
Section "Device"
Identifier "Intel Graphics"
Driver "intel"
Option "TripleBuffer" "false"
Option "SwapbuffersWait" "false"
Option "DRI" "iris"
EndSection
@kj-sh604
kj-sh604 / 11-elecom-deft-pro.conf
Last active August 10, 2024 18:59
personal Elecom Deft Pro Linux XF86/X11 configuration
### Elecom DEFT Pro Button Mappings: ###
# left-click(1) = left-click(1)
# middle-click(2) = middle-click(2)
# right-click(3) = right-click(3)
# scroll-up(4) = scroll-up(4)
# scroll-down(5) = scroll-down(5)
# wheel-tilt-down(6) = wheel-tilt-down(6)
# wheel-tilt-up(7) = wheel-tilt-up(7)
# button-back(8) = button-back(8)
# button-forward(9) = button-forward(9)
#!/bin/sh
# remove ".sh" extension when placing in /bin
builtin cd "$@"