Skip to content

Instantly share code, notes, and snippets.

View narze's full-sized avatar
🕺
You know the rules, and so do I

Manassarn "Noom" Manoonchai narze

🕺
You know the rules, and so do I
View GitHub Profile
KBD Manoonchai "Thai Manoonchai v1.0"
COPYRIGHT "MIT"
COMPANY "Manoonchai"
LOCALENAME "th-TH"
LOCALEID "0000041e"
@narze
narze / gov-project-generator.rb
Last active May 27, 2021 05:55
gov-project-generator
sub = %w[เรา หมอ ชาติ ไทย ครู กรุงเทพ นนท์]
verb = %w[รัก มี เที่ยว ชนะ ชิม ช้อป ใช้ สะดวก พร้อม ไม่ทิ้ง ร่วมใจ]
obj = %w[เรา กัน ไทย ด้วยกัน ชาติ หมอ สะดวก ครู] + [nil]
special_verb = %w[สู้โควิด ปลอดภัย]
normal = sub.product(verb, obj).map(&:join).uniq
special = sub.product(special_verb).map(&:join)
all = (normal + special).sort
async function run() {
const wait = ms => new Promise(resolve => setTimeout(resolve, ms))
const selector = 'div[aria-label="Toggle to follow"] div'
const nodes = [...document.querySelectorAll(selector)]
if (!nodes.length) return
for (let node of nodes) {
const text = node.parentElement.parentElement.parentElement.innerText
า : 1854
น : 1593
ร : 1530
อ : 1139
ก : 1102
เ : 1050
ง : 989
ั : 947
ย : 900
่ : 894
@narze
narze / common_words.txt
Created August 17, 2020 16:31
Most common English words, combined from 4 sources (except 1 character words & proper nouns)
// Source : https://github.com/narze/sandbox/blob/master/ruby/english-common-words.rb
the
of
to
and
in
is
it
that
@narze
narze / .phoenix.js
Created June 24, 2020 16:45
Trolling Window Manager (Proof of concept) with Phoenix.js
Event.on("mouseDidMove", (point) => {
// Phoenix.log(point.x, point.y)
const space = Space.active()
const windows = space.windows({ visible: true })
// TODO: Find nearest window which does not enclose the point
const distances = windows.map((w) => {
const f = w.frame()
// Phoenix.log(w.app().name(), f.x, f.y, f.width, f.height)
@narze
narze / twm.md
Last active March 25, 2021 02:03
Trolling Window Manager
@narze
narze / surfingkeys.js
Last active November 20, 2022 11:07
surfingkeys.js
// 1.0 Compatability
const {
aceVimMap,
mapkey,
imap,
imapkey,
getClickableElements,
vmapkey,
map,
unmap,
@narze
narze / live-coding-notes.md
Last active March 21, 2020 12:51
Live Coding Notes
@narze
narze / pedal.ino
Created January 22, 2020 10:51
Pedal : Arduino foot app switcher
#include <Keyboard.h>
bool pressed = false;
bool currentState;
bool lastState = false;
// the following variables are unsigned longs because the time, measured in
// milliseconds, will quickly become a bigger number than can be stored in an int.
unsigned long lastDebounceTime = 0; // the last time the output pin was toggled
unsigned long debounceDelay = 10; // the debounce time; increase if the output flickers