Skip to content

Instantly share code, notes, and snippets.

View ll931217's full-sized avatar
👾
uWu

Liang-Shih Lin ll931217

👾
uWu
View GitHub Profile
#!/bin/sh
# Source of truth for the install script.
# Also embedded in worker.ts — keep both in sync.
# CI checks for drift on every PR and push (site.yml).
set -eu
REPO="erickochen/purple"
BINARY="purple"
main() {
@ll931217
ll931217 / tokyonight-moon
Created December 30, 2024 01:15
A Tokyo night moon theme for ghostty
palette = 0=#414868
palette = 8=#414868
palette = 1=#f7768e
palette = 9=#f7768e
palette = 2=#73daca
palette = 10=#73daca
palette = 3=#e0af68
@ll931217
ll931217 / autoplay.html
Created November 11, 2024 01:46
Autoplay Video on scroll by checking if video is in viewport
<video id="myVideo" src="video.mp4" muted></video>
<script>
const video = document.getElementId("myVideo");
function autoplayVideo() {
const rect = video.getBoundingClientRect();
if (rect.top >= 0 && rect.bottom <= window.innerHeight) {
video.play();
} else {
video.pause();
@ll931217
ll931217 / surfingkeys
Last active February 19, 2026 07:05
surfingkeys config
// A very tridactyl-esque config file.
// Compatibility Prefix
const {
Clipboard,
Front,
Hints,
Normal,
RUNTIME,
Visual,
@ll931217
ll931217 / yabai_alacritty.md
Created December 13, 2023 07:07
Launching alacritty on Yabai with cmd+enter
# instead of just `alacritty` or `/opt/homebrew/bin/alacritty`
cmd - return : /Applications/Alacritty.app/Contents/MacOS/alacritty
# or
hyper - return : open -n -a 'Alacritty.app'
@ll931217
ll931217 / python_tips.md
Created April 9, 2020 03:07
Python Coding Tips

Finding item in list

Checking if something is inside

This is the use case you describe: Checking whether something is inside a list or not. As you know, you can use the in operator for that:

3 in [1, 2, 3] # => True
@ll931217
ll931217 / code.txt
Created April 27, 2019 04:22
Steam Recovery Code
R12322
@ll931217
ll931217 / Node-sass in electron.md
Last active March 7, 2019 07:26
Steps to make node-sass work in electron

We actually could rebuild node-sass against Electron version. I'm successfully rebuild with following steps :

  • Follow these steps https://github.com/sass/node-sass#rebuilding-binaries until npm install don't need to run last step (node scripts/build -f)
  • In node-sass directory run following : HOME=~/.electron-gyp ./node_modules/node-gyp/bin/node-gyp.js rebuild --target=1.3.4 --arch=x64 --dist-url=https://atom.io/download/atom-shell --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library= -- Note that I'm using Electron version 1.3.4, you can change with your Electron version.
  • The output will be inside build/Release/binding.node Then you can copy that file into your node_modules/node-sass/vendor/darwin-x64-49 folder. -- Note that I'm using darwin-x-64-49, you should match this with your environment. Mine is : OSX 64bit with Electron v1.3.4 (this version using API 49, more info )
@ll931217
ll931217 / self-signed-certificate-with-custom-ca.md
Created November 14, 2018 01:05 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@ll931217
ll931217 / .tmux.conf
Last active February 15, 2024 13:58
i3-gaps config
set -g default-terminal "tmux-256color"
set -g default-command "zsh"
# for vim
set -g @resurrect-strategy-vim 'session'
# for neovim
set -g @resurrect-strategy-nvim 'session'
set -g @resurrect-save-shell-history 'on'
set -g @continuum-restore 'on'
# List of plugins