Skip to content

Instantly share code, notes, and snippets.

View ll931217's full-sized avatar
👾
uWu

Liang-Shih Lin ll931217

👾
uWu
View GitHub Profile
@ll931217
ll931217 / update-zen-browser.sh
Created April 5, 2025 00:41
I use this to install/update my zen browser on linux, it uses the AppImage to launch
#!/bin/bash
# Makes sure the Applications directory is available
mkdir -p "$HOME/Applications"
# GitHub Repository Details
OWNER="zen-browser" # Replace with the repository owner
REPO="desktop" # Replace with the repository name
# Local file to be replaced
@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
Created October 9, 2024 01:40
surfingkeys config
// A very tridactyl-esque config file.
// Compatibility Prefix
const {
Clipboard,
Front,
Hints,
Normal,
RUNTIME,
Visual,
@ll931217
ll931217 / myne.omp.json
Created April 4, 2024 09:45
My oh-my-posh theme
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"segments": [
{
"foreground": "#26C6DA",
"properties": {
"macos": "mac"
@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