Skip to content

Instantly share code, notes, and snippets.

View v3rron's full-sized avatar
:octocat:
Working

Ronen Verdi v3rron

:octocat:
Working
View GitHub Profile
@v3rron
v3rron / statusline.sh
Last active July 31, 2026 18:51
Claude Code custom statusLine
#!/bin/bash
# Row 1: Model | dir@branch | tokens (%used) | effort
# Row 2: 5h %@reset | 7d %@reset | extra used/limit
set -f # disable globbing
input=$(cat)
if [ -z "$input" ]; then
printf "Claude"
@v3rron
v3rron / prompt-dangerous-commands.sh
Created June 12, 2026 18:26
Claude Code PreToolUse hook: prompt for confirmation before dangerous bash commands (rm, git push/reset --hard/clean/rebase/merge/cherry-pick, brew, package publish)
#!/bin/bash
# PreToolUse hook: forces a confirmation prompt for dangerous bash commands.
# Returns permissionDecision: "ask" for dangerous commands, exits 0 (allow) otherwise.
COMMAND=$(jq -r '.tool_input.command' < /dev/stdin)
# Extract the first command in pipes/chains by stripping everything after shell
# operators. Leading VAR=value assignments are stripped first so env-prefixed
# commands (FOO=1 git push) can't dodge the patterns.
BASE_CMD=$(echo "$COMMAND" | sed -E 's/^([A-Za-z_][A-Za-z0-9_]*=[^ ]* +)+//' | sed 's/[;&|].*//' | xargs)
@v3rron
v3rron / microgpt.py
Created April 29, 2026 13:51 — forked from karpathy/microgpt.py
microgpt
"""
The most atomic way to train and run inference for a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp
@v3rron
v3rron / fix_ios_errors.md
Created September 18, 2016 15:29 — forked from aldeed/fix_ios_errors.md
Fix iOS Project Swift Errors

Fix iOS Project Swift Errors

In order to build the iOS app in the latest XCode, you need to convert the project to Swift 3.0. After you do this, when you try to run or archive the project, you will get a bunch of errors. This section explains how to fix them.

IMPORTANT NOTE: Fix all the RED errors. There will also be yellow triangles and the option to "update to recommended settings". Do NOT fix these things and do NOT update to recommended settings.

Info from Apple on what has changed in Swift: http://adcdownload.apple.com/Developer_Tools/Xcode_8_beta_6/Release_Notes_for_Xcode_8_beta_6.pdf ("New in Xcode 8 beta 6 - Swift Compiler" section on page 8)

"NSURL" is not implicitly convertible to "URL"

@v3rron
v3rron / 20140824204154_create_users.rb
Created August 24, 2014 21:27
Devise/Sequel User model migration
Sequel.migration do
change do
create_table :users do
primary_key :id
String :email
String :encrypted_password
String :reset_password_token
DateTime :reset_password_sent_at