Skip to content

Instantly share code, notes, and snippets.

View notexactlyawe's full-sized avatar

Cameron MacLeod notexactlyawe

View GitHub Profile
@eigenraven
eigenraven / sums.sh
Last active November 30, 2017 12:28
Checksums of program outputs
#!/bin/bash
# To run you need to:
# * Have compiled mem_sim.c to mem_sim in the same folder
# * Have mem_trace.txt in the same folder as this script
# * Save the script as sums.sh
# * Run: chmod +x sums.sh
# * Run: ./sums.sh
declare -A checksums
@sunaku
sunaku / interleave.exs
Created September 15, 2015 23:54
Persistent zipping (interleaving) in Elixir.
defmodule Interleave do
def interleave(a, b, result \\ [])
def interleave([], [], result), do: result |> Enum.reverse
def interleave([], b, result), do: interleave(b, [], result)
def interleave([h|t], b, result), do: interleave(b, t, [h | result])
end
iex(1)> split = Regex.split(~r/x/, "fooxbar")
["foo", "bar"]
iex(2)> scan = Regex.scan(~r/x/, "fooxbar")
@gerbsen
gerbsen / ssh_agent_start.fish
Last active January 26, 2024 08:13 — forked from schaary/ssh_agent_start.fish
Auto-launching ssh-agent in fish shell
# content has to be in .config/fish/config.fish
# if it does not exist, create the file
setenv SSH_ENV $HOME/.ssh/environment
function start_agent
echo "Initializing new SSH agent ..."
ssh-agent -c | sed 's/^echo/#echo/' > $SSH_ENV
echo "succeeded"
chmod 600 $SSH_ENV
. $SSH_ENV > /dev/null
@mzabriskie
mzabriskie / README.md
Last active February 5, 2024 15:10
Check git status of multiple repos

If you're like me you have a dir like ~/Workspace/Github where all your git repos live. I often find myself making a change in a repo, getting side tracked and ending up in another repo, or off doing something else all together. After a while I end up with several repos with modifications. This script helps me pick up where I left off by checking the status of all my repos, instead of having to check each one individually.

Usage:

git-status [directory]

This will run git status on each repo under the directory specified. If called with no directory provided it will default to the current directory.