Skip to content

Instantly share code, notes, and snippets.

View foriequal0's full-sized avatar
🤓
I may be slow to respond.

SeongChan Lee foriequal0

🤓
I may be slow to respond.
  • Seoul, South Korea
  • 04:46 (UTC +09:00)
View GitHub Profile
@foriequal0
foriequal0 / google-was-a-web-search-engine.user.js
Last active May 20, 2024 10:45
Google was a web search engine
// ==UserScript==
// @name Google was a web search engine
// @description Redirect to new Google Web search page
// @match https://www.google.com/search*
// @run-at document-start
// @updateURL https://gist.github.com/foriequal0/32290e22f59e6c7c6ff524c46716eae2/raw/google-was-a-web-search-engine.user.js
// @version 0.0.1
// ==/UserScript==
const KEY = "$__google-was-a-web-search-engine";
@foriequal0
foriequal0 / scroll-to-current-file-for-github.user.js
Last active October 3, 2024 03:30
Scroll to current file for GitHub
// ==UserScript==
// @name Scroll to current file for GitHub
// @match https://github.com/*
// @version 4
// ==/UserScript==
function check(callback) {
const result = callback();
if (!result) {
throw new Error("assertion Failed: "+ callback.toString());
@foriequal0
foriequal0 / github-spa-on-navigate.js
Created April 30, 2024 04:58
GitHub SPA listen navigation event
function onNavigate(listener) {
// GitHub uses Turbo for tab navigations.
// You can listen initial page load event, or subsequent tab navigations with this.
// https://turbo.hotwired.dev/reference/events#turbo%3Aload
window.addEventListener("turbo:load", listener);
// For the file/dir navigation, it emits following events to the document.
/*
export const SOFT_NAV_STATE = Object.freeze({
INITIAL: 'soft-nav:initial',
@foriequal0
foriequal0 / tray-organizer.py
Last active June 11, 2024 07:44
Organize tray icons of Windows 11
from dataclasses import dataclass
import re
import os
import sys
import winreg
from win32comext.shell import shell
@dataclass
@foriequal0
foriequal0 / bose-qc35-ii-left-earcup-jumper-wire-pinout
Created April 26, 2024 15:05
Bose QC35 II left earcup jumper wire pinout
Top
* B+ : Red(Thick)
* T : Black/Copper
* B- : Black(Thick)
* LFB- : Green
* R : Black/Red
* LFB+ : White
* LDRV+ : Red/Teal
@foriequal0
foriequal0 / dumb-http-server.rs
Created July 22, 2023 16:02
blocking, synchronous, single thread, non-buffered http server
use std::fs::File;
use std::io::{Read, Write};
use std::net::{TcpListener, TcpStream};
use rand::Rng;
use stream_httparse::streaming_parser::ReqParser;
fn main() -> std::io::Result<()>{
let listener = TcpListener::bind("127.0.0.1:8080")?;
for stream in listener.incoming() {
@foriequal0
foriequal0 / google-spreadsheet-image-context-menu-link.user.js
Last active April 1, 2024 14:48
Google spreadsheet image link context menu
@foriequal0
foriequal0 / podman-docker.conf
Last active August 24, 2022 05:47
Rootless podman-docker
# ~/.config/user-tmpfiles.d/podman-docker.conf
L+ %t/docker.sock - - - - %t/podman/podman.sock
@foriequal0
foriequal0 / aggregate-add-sub-loc.sh
Last active March 29, 2022 08:56
Git author stat
#!/usr/bin/bash
set -euo pipefail
git shortlog -s | cut -c8- | while read -r AUTHOR; do
git log --author="$AUTHOR" --pretty=tformat: --numstat --ignore-all-space -- . \
| gawk -v AUTHOR="$AUTHOR" '{ add += $1; subs += $2; } END { printf "%s, %s, %s\n", AUTHOR, add, subs }' -
done
#!/bin/bash
# PlayOnLinux Function
# Date : see changelog
# Last revision : see changelog
# Author : Unknown
# Only For : http://www.playonlinux.com
# CHANGELOG:
# [Unknown] (?)
# Initial script.