Skip to content

Instantly share code, notes, and snippets.

View expelledboy's full-sized avatar

Anthony Jackson expelledboy

View GitHub Profile
@expelledboy
expelledboy / setup_nix.sh
Last active June 4, 2024 08:30
Reproductive dev env using NixPkgs
# Install nix
# https://nixos.org/download.html#nix-install-macos
sh <(curl -L https://nixos.org/nix/install)
# Enable nix command (flakes already enabled for nix >= 2.4.0)
mkdir -p ~/.config/nix
echo 'experimental-features = nix-command flakes' >> ~/.config/nix/nix.conf
cat ~/.config/nix/nix.conf
@expelledboy
expelledboy / install_nixpkgs_with_flake.md
Created August 7, 2023 14:13
Installing NixPkgs with Flake support

Ubuntu Docker Image

FROM ubuntu:latest

RUN set -x \
	&& apt-get update \
	&& apt-get install -y --no-install-recommends curl xz-utils ca-certificates \
	&& rm -rf /var/lib/apt/lists/*
@expelledboy
expelledboy / hello-world.sh
Created August 13, 2022 21:41
Hello world for sh/bash
#!/usr/bin/env sh
NAME=${1:-World}
echo "Hello, ${NAME}!"
@expelledboy
expelledboy / pre-commit-check-git-commit-size.sh
Last active November 24, 2022 06:48
Git pre-commit hook that rejects commits that are too large
#!/usr/bin/env bash -eou pipefail
# https://www.backblaze.com/blog/how-many-bytes-are-in-a-megabyte-really/
size_limit=$((2 * 2**20)) # 2mbs
# https://git-scm.com/docs/git-rev-list#Documentation/git-rev-list.txt---disk-usage
commit_size=$(git rev-list --disk-usage HEAD^..HEAD)
test "$commit_size" -lt "$size_limit" || (
echo "Commit size is too large: $commit_size > $size_limit"
echo "Force commit using --no-verify"

Keybase proof

I hereby claim:

  • I am expelledboy on github.
  • I am expelledboy (https://keybase.io/expelledboy) on keybase.
  • I have a public key ASCtq1ZGGCeKJzCsoHVl4I-gwxyI1hoMZzfb8yZgvaoZ4Ao

To claim this, I am signing this object:

@expelledboy
expelledboy / uninstall-nix-osx.sh
Last active October 6, 2024 07:10
Trying Nix
#!/bin/bash
# !!WARNING!!
# This will DELETE all efforts you have put into configuring nix
# Have a look through everything that gets deleted / copied over
nix-env -e '.*'
rm -rf $HOME/.nix-*
rm -rf $HOME/.config/nixpkgs
@expelledboy
expelledboy / vimrc
Last active February 15, 2017 09:50
vimrc
if !filereadable(expand('~/.vim/plugin/source.vim'))
silent !curl -fLo ~/.vim/plugin/source.vim --create-dirs https://raw.githubusercontent.com/suderman/source.vim/master/plugin/source.vim
endif
" load config from gists :D
runtime plugin/source.vim
Source https://gist.githubusercontent.com/expelledboy/20d2b1a63d8d44e95016/raw/cbe125eb002ccbca86f74474510219b03ddf590a/backups.vim