Skip to content

Instantly share code, notes, and snippets.

View mgilliam's full-sized avatar

Matt Gilliam mgilliam

View GitHub Profile
@mgilliam
mgilliam / generate-ssh-key.sh
Created January 27, 2021 23:48 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/mozilla_rsa
@mgilliam
mgilliam / grouper.ipynb
Created March 2, 2018 20:54
Pandas Time Grouper
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mgilliam
mgilliam / node-and-npm-in-30-seconds.sh
Created August 2, 2012 20:59 — forked from isaacs/node-and-npm-in-30-seconds.sh
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl http://npmjs.org/install.sh | sh
@mgilliam
mgilliam / gitstats.sh
Created April 24, 2012 20:35
Get commits by month for a given time range and output to tab-delimited text.
#!/bin/bash
stats_file="${HOME}/Dropbox/projects/loc/stats.txt"
start_date='2011-04-01'
end_date='2012-04-01'
sep='\t'
echo -en ${sep} > "${stats_file}"
months=(Apr May Jun Jul Aug Sep Oct Nov Dec Jan Feb Mar)
@mgilliam
mgilliam / clients.md
Created April 5, 2012 23:01 — forked from defunkt/clients.md
A list of Gist clients.

Gist Clients

Want to create a Gist from your editor, the command line, or the Services menu? Here's how.

Editor Support

@mgilliam
mgilliam / install-git-completion.sh
Created April 5, 2012 19:23 — forked from johngibb/install-git-completion.sh
Mac OS X - Install Git Completion
GIT_VERSION=`git --version | awk '{print $3}'`
URL="https://raw.github.com/git/git/v$GIT_VERSION/contrib/completion/git-completion.bash"
PROFILE="$HOME/.profile"
echo "Downloading git-completion for git version: $GIT_VERSION..."
if ! curl "$URL" --silent --output "$HOME/.git-completion.bash"; then
echo "ERROR: Couldn't download completion script. Make sure you have a working internet connection." && exit 1
fi
@mgilliam
mgilliam / deannotate.sh
Created March 19, 2012 17:01
Remove local and remote tag annotation.
#!/bin/bash
#
# Remove annotation from local and remote tags.
#
# This works fine for simple repositories. However, if a tag checkout would
# result in a message about an untracked directory that cannot be removed,
# things could get ugly. Before trying this, make a backup that's not
# associated with the origin (i.e., `git clone repo repo-bak`) from which to
# recover.
@mgilliam
mgilliam / put.sh
Created October 22, 2011 07:43
Publish a repository w/ all branches and tags to Github.
#!/bin/bash
#
# Publish a repository - including all branches and tags - to Github,
# optionally specifying an organization to which the private repository
# belongs.
usage=$(
cat <<EOF
$0 [-f | -o <org>] <repo>
-f Force: If a remote exists, replace it.
@mgilliam
mgilliam / get.sh
Created October 22, 2011 06:23
Clone a git repository and create a local tracking branch for each remote branch.
#!/bin/bash
#
# Clone a git repository and create a local tracking branch for each remote
# branch, optionally disconnecting from the remote.
usage=$(
cat <<EOF
$0 [-d] <repo>
-d Disconnect from the remote when finished.
EOF