Skip to content

Instantly share code, notes, and snippets.

@noih
noih / parse.ts
Created March 11, 2024 09:59
Parse CSS loop version
/**
* Parse CSS loop verison
*
* recursive version https://gist.github.com/noih/9eae4b2fab4676a7b79b46c2200dece2
*
* @link https://playcode.io/1794542
* @author noih.dev
*/
type Style = Record<string, string>
@noih
noih / README.md
Created February 20, 2024 03:13
Multiple git accounts

SSH Config [^1]

~/.ssh/config

If the file does not exist, create it manually

Host account_a.gitlab.com
  Hostname gitlab.com
  PreferredAuthentications publickey
 IdentityFile ~/.ssh/account_a_priv_key
@noih
noih / parse.ts
Last active March 11, 2024 10:00
Parse CSS recursive version
/**
* Parse CSS recursive version
*
* loop version https://gist.github.com/noih/e77bb88f2d08ac6b0df67217b4d22d95
*
* @link https://playcode.io/1765882
* @author noih.dev
*/
type Style = Record<string, string>
@noih
noih / chars.js
Created September 12, 2023 05:36
chinese words
const str = `
#Char Unicode Big5
§ 00A7 A1B1
¯ 00AF A1C2
° 00B0 A258
± 00B1 A1D3
· 00B7 A150
× 00D7 A1D1
÷ 00F7 A1D2
ˇ 02C7 A3BE
@noih
noih / index.js
Last active August 20, 2023 17:12
PixiJS v7 - Prevent text flickering after scaling and achieve smoother rendering using batch updates
/**
* PixiJS v7 - Prevent text flickering after scaling and achieve smoother rendering using batch updates.
*
* @version 2
* @author noih.dev
* @since 2023-08-21
* @link https://codesandbox.io/s/batch-update-text-7qxktt?file=/src/index.mjs:0-3081
*/
import * as PIXI from 'pixi.js'
import { Viewport } from 'pixi-viewport'
@noih
noih / index.js
Last active August 21, 2023 09:53
PixiJS - Prevent text flickering caused by scaling
/**
* PixiJS v7 - Prevent text flickering caused by scaling
*
* @version 1
* @author noih.dev
* @since 2023-08-21
* @link https://gist.github.com/noih/21a58792cbc3477fa751c47a92aa59b7
* @link https://codesandbox.io/s/render-text-rpvksn?file=/src/index.mjs:0-2349
*/
import * as PIXI from 'pixi.js'
@noih
noih / fetch.js
Last active July 13, 2023 09:57
fans to array
(async()=>{const b=document.getElementsByClassName("_aano")[0];await new Promise(a=>{const c=(d,e=5)=>(console.log("next",d,e),d===b.scrollHeight||0>=e?a():void(b.scrollTop=b.scrollHeight,setTimeout(()=>{c(b.scrollTop,d===b.scrollTop?e-1:e)},2e3)));c()}),console.log([...document.querySelectorAll("._aano span > span")].reduce((a,b,c)=>`${a}${c%2?",":"\n"}${b.innerText}`,"").split("\n").filter(a=>!!a))})();
@noih
noih / switch.sh
Created March 8, 2023 13:40
switch ssh key
#!/bin/bash
# debug
#ssh -Tvvv git@gitlab.com
# clear
PS3="clear all ?"
select num in "clear" "no"
do
if [ "${num}" == "clear" ]; then
global foodHotKey := "1" ; 1 ~ 5, eat food or skill
#NoEnv
#SingleInstance, Force
SendMode, Input
SetBatchLines, -1
SetWorkingDir, %A_ScriptDir%
^r::Reload
Delete::ExitApp
#SingleInstance, Force
#NoEnv
SetBatchLines -1
ListLines Off
SendMode Input
SetDefaultMouseSpeed, 2
SetWorkingDir, %A_ScriptDir%
Delete::ExitApp