Skip to content

Instantly share code, notes, and snippets.

View doub1ejack's full-sized avatar

Micah Mutrux doub1ejack

View GitHub Profile
@EdgeCaseBerg
EdgeCaseBerg / CustomShellPrompt.scala
Created August 2, 2017 16:08
Make a git prompt in sbt!
import sbt._
import Keys._
// This lifted from https://github.com/mingchuno/aws-wrap/blob/master/project/CustomShellPrompt.scala
object CustomShellPrompt {
val Branch = """refs/heads/(.*)\s""".r
def gitBranchOrSha =
(Process("git symbolic-ref HEAD") #|| Process("git rev-parse --short HEAD")).!! match {
@ccstone
ccstone / BBEdit-TextWrangler_RegEx_Cheat_Sheet.txt
Last active March 30, 2024 07:53
BBEdit-TextWrangler Regular Expression Cheat-Sheet
————————————————————————————————————————————————————————————————————————————————————————————————————
BBEdit / BBEdit-Lite / TextWrangler Regular Expression Guide Modified: 2018/08/10 01:19
————————————————————————————————————————————————————————————————————————————————————————————————————
NOTES:
The PCRE engine (Perl Compatible Regular Expressions) is what BBEdit and TextWrangler use.
Items I'm unsure of are marked '# PCRE?'. The list while fairly comprehensive is not complete.
@alexras
alexras / ssh-agent-snippets.sh
Created October 17, 2011 00:14
Bash snippets to automatically start and stop an ssh-agent process on login and logout
#!/bin/bash
## in .bash_profile
SSHAGENT=`which ssh-agent`
SSHAGENTARGS="-s"
if [ -z "$SSH_AUTH_SOCK" -a -x "$SSHAGENT" ]; then
eval `$SSHAGENT $SSHAGENTARGS`
trap "kill $SSH_AGENT_PID" 0
fi