Skip to content

Instantly share code, notes, and snippets.

View balazs4's full-sized avatar

balazs4

  • Bavaria, Germany
  • 14:18 (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=""

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 / regex.js
Created January 26, 2022 21:10 — forked from DavidJCobb/regex.js
Helper for defining regexes
//
// This file contains a JavaScript tag function to let you
// define regexes without needing to backslash-escape every
// forward slash in the regex text; good for URLs.
//
function regex(tag) {
return new RegExp(tag.raw, "i");
}
@balazs4
balazs4 / .vimrc
Created November 21, 2021 16:58 — forked from romannmk/.vimrc
Simple vimrc configuration
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plugin 'pangloss/vim-javascript', { 'for': ['javascript', 'javascript.jsx'] }
Plugin 'mxw/vim-jsx', { 'for': ['javascript', 'javascript.jsx'] }
@balazs4
balazs4 / .tmux.conf
Created November 3, 2021 08:08 — forked from rsp/.tmux.conf
The best and greatest tmux.conf ever - improved!
# The best and greatest tmux.conf ever - improved!
# https://gist.github.com/rsp/f4770a1fe8ea7e2378ac3a16e01a2b53
# Here are some customizations done by Rafał Pocztarski:
# use Ctrl+Backslash instead of Ctrl+A or Ctrl+B
# use Slash to split vertically
# use Backslash to split horizontally
unbind-key C-b
set -g prefix 'C-\'
bind-key 'C-\' send-prefix
@balazs4
balazs4 / vim_and_definitions.md
Created October 31, 2021 20:02 — forked from igemnace/vim_and_definitions.md
"Jump to Definition" in Vim

Vim and Definitions

Did you know Vim has a few builtin features designed to help with the "Jump to Definition" action you see in most IDEs?

Level 1: include and define

Since Vim is a "dumb" editor (that is, it doesn't do any static analysis on your text), you'd expect a "Jump to Definition" feature that relies on a simple text search.

@balazs4
balazs4 / vimrc
Created October 10, 2021 07:54 — forked from junegunn/vimrc
set nocompatible hidden laststatus=2
if !filereadable('/tmp/plug.vim')
silent !curl --insecure -fLo /tmp/plug.vim
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
endif
source /tmp/plug.vim
call plug#begin('/tmp/plugged')
Plug 'junegunn/fzf', { 'do': './install --bin' }
@balazs4
balazs4 / auth_request.conf
Created March 9, 2021 21:14 — forked from nginx-gists/auth_request.conf
Validating OAuth 2.0 Access Tokens with NGINX and NGINX Plus
server {
listen 80;
location / {
auth_request /_oauth2_token_introspection;
proxy_pass http://my_backend;
}
location = /_oauth2_token_introspection {
internal;