Skip to content

Instantly share code, notes, and snippets.

View ariel-frischer's full-sized avatar
:shipit:

Ariel Frischer ariel-frischer

:shipit:
View GitHub Profile
@ariel-frischer
ariel-frischer / lint-format-code.sh
Last active July 11, 2025 20:44
General Claude Code Lint+Format Hook
#!/bin/bash
# Claude Code PostToolUse Hook for Auto-formatting and Linting
#
# This script integrates with Claude Code's hook system to automatically
# format and lint files after they're edited or created.
#
# How it works:
# 1. Claude Code calls this script after Write/Edit/MultiEdit|Update operations
# 2. The script receives JSON input via stdin containing:
# - session_id: Current Claude session
@ariel-frischer
ariel-frischer / aws_cost_table.sh
Created March 8, 2025 07:12
aws bash script to get simple cost tables for the last 7 days
#!/usr/bin/env bash
set -euo pipefail
# Get cost and usage data from AWS Cost Explorer
result=$(aws ce get-cost-and-usage --no-cli-pager \
--time-period Start=$(date -d '7 days ago' '+%Y-%m-%d'),End=$(date '+%Y-%m-%d') \
--granularity DAILY \
--metrics "BlendedCost" "UsageQuantity" \
--group-by Type=DIMENSION,Key=SERVICE)
@ariel-frischer
ariel-frischer / aws_cost_table.sh
Last active February 23, 2025 06:55
Pretty print aws usage per service for last 7 days
#!/usr/bin/env bash
set -euo pipefail
# Get cost and usage data from AWS Cost Explorer
result=$(aws ce get-cost-and-usage --no-cli-pager \
--time-period Start=$(date -d '7 days ago' '+%Y-%m-%d'),End=$(date '+%Y-%m-%d') \
--granularity DAILY \
--metrics "BlendedCost" "UsageQuantity" \
--group-by Type=DIMENSION,Key=SERVICE)
@ariel-frischer
ariel-frischer / .zshrc
Created February 12, 2025 21:58
Fast and Easy AI Git ADD, COMMIT, PUSH alias 'ocp'
# Install + configure https://github.com/di-sukharev/opencommit
# Use ocp for quick git add + commit + push
function ocp() {
local remote="$1"
git add -A
oco --yes
if [ -n "$remote" ]; then
git push "$remote"
else
git push
@ariel-frischer
ariel-frischer / fzf-kitty-tabs.sh
Last active April 29, 2024 00:18
FZF usage for kitty go to terminal tabs
!/bin/sh
# Kitty fzf to tab!
# Author: Ariel Frischer
# Add below mapping to your kitty.conf file (usually in ~/.config/kitty/)
# map super+j launch --type=overlay --stdin-source=@screen_scrollback /PATH_OF_THIS_FILE/fzf-kitty-tabs.sh
active_tab="$(
kitty @ ls | jq -r '
@ariel-frischer
ariel-frischer / delete_forked_repos.sh
Last active June 4, 2023 08:01
Delete All Forked Github Repositories (dry-run by default)
#!/bin/bash
USERNAME="GITHUB-USERNAME"
# Download github cli -> https://cli.github.com/
# You may need to run:
# chmod +x delete_forked_repos.sh
# gh auth login
# gh auth refresh -h github.com -s delete_repo
@ariel-frischer
ariel-frischer / surfkeys.txt
Last active February 8, 2022 00:08
Sufkeys Config
// an example to create a new mapping `ctrl-y`
//map('<ctrl-y>', 'Show me the money', function() { // Front.showPopup('a well-known phrase uttered by characters in the 1996 film Jerry Maguire (Escape to close).'); //}); // an example to replace `T` with `gt`, click `Default mappings` to see how `T` works. //jmap('gt', 'T'); // an example to remove mapkey `Ctrl-i` //unmap('<ctrl-i>');
// set theme
// ---- Hints ----
// Hints have to be defined separately
// Uncomment to enable
// Fix Color Issues while using DarkReader extension!
api.Hints.style(
@ariel-frischer
ariel-frischer / .tmux.conf
Created February 1, 2022 02:00
~/.tmux.conf for iTerm2
###########################
# ~/.tmux.conf for iTerm2 #
# #
# by Jovian Lin #
###########################
##########
# Basics #
##########
@ariel-frischer
ariel-frischer / color.ts
Created December 7, 2020 02:26 — forked from EvAlex/color.ts
TypeScript Color class, useful to manipulate rgba components and convert to rga/rgba/hex
export const RGB_COLOR_REGEX = /\((\d+),\s*(\d+),\s*(\d+)(,\s*(\d*.\d*))?\)/;
export class Color {
public r: number;
public g: number;
public b: number;
public a: number;
constructor()
constructor(colorStr?: string)
sudo yum install autoconf automake bzip2 bzip2-devel cmake freetype-devel gcc gcc-c++ git libtool make mercurial pkgconfig zlib-devel -y
mkdir ~/ffmpeg_sources
# nasm
cd ~/ffmpeg_sources
curl -O -L https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/nasm-2.14.02.tar.bz2
tar xjvf nasm-2.14.02.tar.bz2
cd nasm-2.14.02
./autogen.sh
./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin"