Skip to content

Instantly share code, notes, and snippets.

@mnsami
mnsami / statusline.js
Last active November 10, 2026 12:08
Claude Code status line: model, git/jj branch, directory, context meter
#!/usr/bin/env node
/**
* Statusline: {model} │ {task|branch} │ {dir}{context meter}
*
* Middle segment prefers the in-progress todo (bold); falls back to the git
* branch (dim). Context meter mirrors Claude Code's own accounting: the
* auto-compact buffer is excluded so the bar reaches 100% when compaction
* actually triggers, not when the raw window fills.
*/
@mnsami
mnsami / download_egghead_videos.sh
Last active August 4, 2022 06:27
this script is to download egghead videos using youtube-dl
#!/bin/bash
usage() { echo "usage: --coursename [--coursename \"build-a-react-app-with-redux\"] --type [--type \"courses|lessons\"]" 1>&2; exit 1; }
OPTS=$(getopt -o c:t: --long coursename:,type: -n 'download_egghead_videos.sh' -- "$@")
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
eval set -- "$OPTS"

Keybase proof

I hereby claim:

  • I am mnsami on github.
  • I am minansami (https://keybase.io/minansami) on keybase.
  • I have a public key ASAEXSESoaKe99dq2Wqd9LNKRiyaCiWvmJkX0-O9d3hjVAo

To claim this, I am signing this object:

#!/bin/bash
apt-get remove $(dpkg -l|awk '/^ii linux-image-/{print $2}'|sed 's/linux-image-//'|awk -v v=`uname -r` 'v>$0'|sed 's/-generic//'|awk '{printf("linux-headers-%s\nlinux-headers-%s-generic\nlinux-image-%s-generic\n",$0,$0,$0)}')
@mnsami
mnsami / crawl-website.sh
Created January 4, 2016 16:25
wget to download website for offline viewing
#!/bin/sh
wget=/usr/bin/wget
if [ ! -x "$wget" ]; then
echo "ERROR: No wget." >&2
exit 1
fi
# This script is to download website to make it available for offline viewing.