Skip to content

Instantly share code, notes, and snippets.

View jstuckey's full-sized avatar

Jeremy Stuckey jstuckey

View GitHub Profile
@jstuckey
jstuckey / Bash Prompt with Git and Emoji
Last active October 13, 2022 02:06
Bash Prompt with Git and Emoji - Add to ~/.bash_profile
git_branch='`git rev-parse --abbrev-ref HEAD 2> /dev/null | sed s/^/\ \|\ /`'
emojis=(🐶 🐺 🐱 🐭 🐹 🐰 🐸 🐯 🐨 🐻 🐷 🐮 🐵 🐼 🐧 🐍 🐢 🐙 🐠 🐳 🐬 🐥)
emoji='`echo ${emojis[$RANDOM % 22]}`'
PS1="\[\033[0;36m\]\T | \W$git_branch | $emoji > \[\e[0m\]"
@jstuckey
jstuckey / .bash_profile additions
Last active May 15, 2019 02:59
.bash_profile additions
PS1="\[\033[0;36m\]\u | \T | \W > \[\e[0m\]"
echo -e "\033[0;31m\n --------------------"
echo -e "\033[0;31m - \033[0;36mWelcome, Jeremy! \033[0;31m-"
echo -e "\033[0;31m --------------------\n"
@jstuckey
jstuckey / gitconfig
Last active May 15, 2019 02:59
My ~/.gitconfig file. Sets svn style shortcuts, turns on color, sets the default editor, sets user.
[alias]
st = status . -sb
ci = commit
co = checkout
br = branch
cb = rev-parse --abbrev-ref HEAD
conflicts = diff --name-only --diff-filter=U
recent = "!git for-each-ref --sort=-committerdate refs/heads/ | sed s/.*refs\\\\/heads\\\\/// | head"
[color]
ui = 1
@jstuckey
jstuckey / git-st
Created August 15, 2013 20:12
Custom "git status" command to display additional information. Place in /user/bin and then type "git st" while in a git repo.
#!/bin/bash#!/bin/bash
echo
echo "User Name: $(git config user.name)"
echo "Email: $(git config user.email)"
echo
git status . -sb
echo
@jstuckey
jstuckey / DefaultKeyBinding.dict
Last active December 26, 2015 03:59
Make Home and End keys for Mac behave like they do on Windows: Home goes to the beginning of the line, and End goes to the end of the line. Place this file in ~/Library/KeyBindings/DefaultKeyBinding.dict
{
"\UF729" = "moveToBeginningOfLine:";
"$\UF729" = "moveToBeginningOfLineAndModifySelection:";
"\UF72B" = "moveToEndOfLine:";
"$\UF72B" = "moveToEndOfLineAndModifySelection:";
"^\UF729" = "moveToBeginningOfDocument:";
"^\UF72B" = "moveToEndOfDocument:";
"$^\UF729" = "moveToBeginningOfDocumentAndModifySelection:";
"$^\UF72B" = "moveToEndOfDocumentAndModifySelection:";
}
@jstuckey
jstuckey / gist:9c0e5f7f46a6922e01a5
Last active August 29, 2015 14:02
Zlib Module - Demo for Node.dc
// Zlib - Node wrapper around the zlib compression library
var zlib = require('zlib');
var gzip = zlib.createGzip();
var gunzip = zlib.createGunzip();
var fs = require('fs');
var inStream1 = fs.createReadStream('input.txt');
var outStream1 = fs.createWriteStream('tmp/output.txt.gz');
// Compress input.txt using gzip
@jstuckey
jstuckey / palindrome.rb
Created February 20, 2014 02:54
Check if word is a palindrome
def is_palindrome(string_to_check)
if string_to_check.length == 0
return false
end
the_start = 0
the_end = string_to_check.length - 1