Skip to content

Instantly share code, notes, and snippets.

View trevmex's full-sized avatar
👨‍👩‍👧‍👦

Trevor Menagh trevmex

👨‍👩‍👧‍👦
View GitHub Profile
@trevmex
trevmex / git_prompt.sh
Created July 24, 2012 15:06
Add git messaging to your bash prompt
#
# Colors
#
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
NORMAL="\[\033[0m\]"
#
# Prompt Setup
@trevmex
trevmex / up.sh
Created June 20, 2012 15:15
up - a bash script that updates either a git or an svn repo
#!/usr/bin/env bash
#
# up - a bash script that updates either a git or an svn repo.
#
# Copyright (c) 2012 Trevor Lalish-Menagh
#
# 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
@trevmex
trevmex / up.sh
Created June 20, 2012 15:15
up - a bash script that updates either a git or an svn repo
#!/usr/bin/env bash
#
# up - a bash script that updates either a git or an svn repo.
#
# Copyright (c) 2012 Trevor Lalish-Menagh
#
# 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
@trevmex
trevmex / nil_stuff
Created May 8, 2012 19:15
The diff between !foo == nil and !foo.nil?
jruby-1.6.7.2 :013 > !foo == nil
NameError: undefined local variable or method `foo' for #<Object:0x26796e1c>
from (irb):13:in `evaluate'
from org/jruby/RubyKernel.java:1083:in `eval'
from /Users/tmenag200/.rvm/rubies/jruby-1.6.7.2/lib/ruby/1.8/irb.rb:158:in `eval_input'
from /Users/tmenag200/.rvm/rubies/jruby-1.6.7.2/lib/ruby/1.8/irb.rb:271:in `signal_status'
from /Users/tmenag200/.rvm/rubies/jruby-1.6.7.2/lib/ruby/1.8/irb.rb:155:in `eval_input'
from org/jruby/RubyKernel.java:1410:in `loop'
from org/jruby/RubyKernel.java:1183:in `catch'
from /Users/tmenag200/.rvm/rubies/jruby-1.6.7.2/lib/ruby/1.8/irb.rb:154:in `eval_input'
@trevmex
trevmex / pom-snippit.xml
Created May 3, 2012 01:56
Eclipse Maven Plugin for Scala Spring Apps
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<additionalBuildcommands>
<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
<buildcommand>org.eclipse.m2e.core.maven2Builder</buildcommand>
</additionalBuildcommands>
<additionalProjectnatures>
@trevmex
trevmex / index.html
Created May 2, 2012 02:09
An HTML page to give you a jumping off point for NOT goofing off.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Do something productive!</title>
<style>
label {
display: block;
margin-bottom: 0.5em;
}
if (!Array.prototype.filter) {
Array.prototype.filter = function (fun, thisp) {
"use strict";
if (typeof this === "undefined" || this === null) {
throw new TypeError();
}
if (typeof fun !== "function") {
throw new TypeError();
}
@trevmex
trevmex / footer.html
Created August 7, 2011 19:34
This is an iFrame Helper that adds a function called reloadIframesOnClick which reloads all the sibling iFrames on a page that share a domain on a click event.
@trevmex
trevmex / .bashrc
Created July 6, 2011 23:21
Adding git and svn info to the prompt
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo " ("${ref#refs/heads/}$(parse_git_dirty)")"
}
function parse_svn_repo {
@trevmex
trevmex / .screenrc
Created June 29, 2011 13:06
My Screen config
#----------
# jumex's .screenrc config file
# Make the bell visible instead of audible
vbell on
vbell_msg "Ding"
vbellwait 0
# Shut off the startup message
startup_message off