Skip to content

Instantly share code, notes, and snippets.

View crittelmeyer's full-sized avatar

Chris Rittelmeyer crittelmeyer

  • Olive
  • Atlanta, GA
View GitHub Profile
@crittelmeyer
crittelmeyer / cmd
Created May 17, 2014 04:14
A bash script to quickly create new bash scripts. It's scriptception.
#!/bin/bash -e
filename=$1
script_root=/usr/bin
editor=vi
createScriptIfItDoesntExist() {
if [ ! -f $1 ]; then
touch $1
chmod +x $1
@crittelmeyer
crittelmeyer / ll
Created May 17, 2014 04:55
A shortcut for ls -al
#!/bin/bash -e
ls -al
@crittelmeyer
crittelmeyer / git-ignore-all
Last active April 12, 2017 14:36
Shell script that adds all untracked files to .gitignore
#!/bin/bash -e
git status -s | grep -e "^??" | cut -c 4- >> .gitignore
@crittelmeyer
crittelmeyer / open-tab
Last active November 11, 2022 08:06
Shell script to open a new Mac OS X terminal tab.
#!/bin/bash -e
osascript -e 'tell application "Terminal" to activate' -e 'tell application "System Events" to tell process "Terminal" to keystroke "t" using command down'
_
_._ _..._ .-', _.._(`))
'-. ` ' /-._.-' ',/
) \ '.
/ _ _ | \
| a a / |
\ .-. ;
'-('' ).-' ,' ;
'-; | .'
\ \ /
@crittelmeyer
crittelmeyer / rain.sh
Last active October 11, 2015 21:10 — forked from livibetter/README.md
#!/bin/bash
# Let it Rain!
# Copyright (C) 2011, 2013 by Yu-Jie Lin
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
echo -e "\e[1;40m" ; clear ; while :; do echo $LINES $COLUMNS $(( $RANDOM % $COLUMNS)) $(( $RANDOM % 72 )) ;sleep 0.05; done|awk '{ letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()"; c=$4; letter=substr(letters,c,1);a[$3]=0;for (x in a) {o=a[x];a[x]=a[x]+1; printf "\033[%s;%sH\033[2;32m%s",o,x,letter; printf "\033[%s;%sH\033[1;37m%s\033[0;0H",a[x],x,letter;if (a[x] >= $1) { a[x]=0; } }}'
@crittelmeyer
crittelmeyer / gist:169b83e6c2037457908e
Created June 16, 2015 18:23
I'm watching you... #prank
crontab -e
*/30 * * * * say -v whisper "I am watching you"
@crittelmeyer
crittelmeyer / tmux_cheatsheet.markdown
Last active September 27, 2023 19:37 — forked from henrik/tmux_cheatsheet.markdown
tmux cheatsheet

tmux/tmuxinator cheatsheet

tmux

As configured in my dotfiles, here and here.

Command line

$ tmux                           -> start new
$ tmux new -s myname             -> start new w/session name
$ tmux a  #  (or at, or attach)  -> attach
$ tmux a -t myname               -> attach to named
#!/usr/bin/python
# Adapted from http://kutuma.blogspot.com/2007/08/sending-emails-via-gmail-with-python.html
import getpass
import smtplib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase import MIMEBase
from email.MIMEText import MIMEText
from email import Encoders
import os