Skip to content

Instantly share code, notes, and snippets.

View balazs4's full-sized avatar

balazs4

  • Bavaria, Germany
  • 11:28 (UTC +01:00)
View GitHub Profile
@balazs4
balazs4 / vertex.js
Created March 1, 2026 14:39 — forked from LukeB42/vertex.js
Superlight SPA framework
/**
* vertex.js — single-file library combining:
*
* 1. VQuery — DOM layer (hn.js-inspired, jQuery surface-compatible)
* 2. Reconciler — Fiber-based React clone (pomb.us architecture + hooks)
* 3. template — Mustache template engine + component loader (Vertex.template)
* 4. Router — Backbone-style hash router (class-based + singleton)
* 5. Glue — useHash hook, unified Vertex namespace
*
* jQuery compatibility: if jQuery / $ already exist on the page they are
@balazs4
balazs4 / duck.sh
Created July 15, 2025 09:17 — forked from gcrbr/duck.sh
Use DuckDuckGo's AI chat from terminal. Only requires curl
vqd=""
current_payload=""
send_chat_message() {
out=$(curl -s -v -X POST 'https://duckduckgo.com/duckchat/v1/chat' -H "Cookie: dcm=3; dcs=1" -H "Referer: https://duckduckgo.com/" -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36" -H "x-vqd-4: $vqd" -H 'Content-Type: application/json' -d "$current_payload" 2>&1)
req_body=$(echo "$out" | awk 'BEGIN{a=0;b=0;}{if($1=="<"){a=1;} if(a==1&&$1=="{"){b=1;} if(b>0){b+=1;} if(b>3){print $0}}')
if [[ ! "$req_body" =~ \{\"action\":\"error\" ]]; then
msg=""
append=""
# sudo systemctl enable slock@balazs4.service
[Unit]
Description=Lock X session using slock for user %i
Before=sleep.target
[Service]
User=%i
Type=simple
Environment=DISPLAY=:0
ExecStart=/usr/bin/slock

Vim Manipulation Cheat Sheet

Action

Key Result
v select
y copy (yank)
c change
d delete
@balazs4
balazs4 / disable all macos animations
Created March 28, 2024 10:18 — forked from j8/disable all macos animations
disable all macos animations for high performance
defaults write -g NSScrollViewRubberbanding -int 0
defaults write -g NSAutomaticWindowAnimationsEnabled -bool false
defaults write -g NSScrollAnimationEnabled -bool false
defaults write -g NSWindowResizeTime -float 0.001
defaults write -g QLPanelAnimationDuration -float 0
defaults write -g NSScrollViewRubberbanding -bool false
defaults write -g NSDocumentRevisionsWindowTransformAnimation -bool false
defaults write -g NSToolbarFullScreenAnimationDuration -float 0
defaults write -g NSBrowserColumnAnimationSpeedMultiplier -float 0
defaults write com.apple.dock autohide-time-modifier -float 0
@balazs4
balazs4 / setup
Last active July 5, 2024 08:38
arch@rpi
# aarch64
# arch config
ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
echo piserver > /etc/hostname
sed -i 's/#en_US.UTF-8/en_US.UTF-8/' /etc/locale.gen
sed -i 's/#C.UTF-8/C.UTF-8/' /etc/locale.gen
locale-gen
echo 'LANG=en_US.UTF-8' > /etc/locale.conf
pacman-key --init
pacman-key --populate archlinuxarm
services:
pihole:
image: pihole/pihole:latest
network_mode: host
environment:
TZ: 'Europe/Berlin'
WEBPASSWORD: '********'
PIHOLE_DNS_: 8.8.4.4;1.0.0.1;8.8.8.8;1.1.1.1
cap_add:
- NET_ADMIN