Skip to content

Instantly share code, notes, and snippets.

View jmeridth's full-sized avatar
:shipit:
pushing buttons on my keyboard

Jason Meridth jmeridth

:shipit:
pushing buttons on my keyboard
View GitHub Profile
@jmeridth
jmeridth / gm.sh
Created October 12, 2011 12:56 — forked from jmarnold/gm.sh
The Good Morning Command
function rebasei {
branch_name="$(git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1 /')"
echo "Currently on $branch_name"
git checkout master
git pull origin master
git checkout $branch_name
git rebase -i master
}
function finishrebase {
@jmeridth
jmeridth / .rebase.sh and .finishrebase.sh
Created October 6, 2011 19:50
bash scripts to speed up rebasing, pauses on interactive rebase commits (so I can squash, edit, etc)
# REBASE
#!/bin/bash
if [ $# -eq 1 ]
then
git checkout master && git pull origin master && git checkout $1 && git rebase -i master
else
echo 'Please provide a feature branch: ./rebase.sh feature1324'
fi
@jmeridth
jmeridth / visitor_pattern_implementation_ruby_20081130_blogpost.rb
Created July 6, 2011 18:37
ruby implementation for visitor pattern blog post
class Employee
attr_reader :name
attr_accessor :sickDaysUsed
attr_accessor :vacationDaysUsed
def initialize(name)
@name = name
@sickDaysUsed = 0
@vacationDaysUsed = 0
end
def addSickDaysUsed(sickDaysUsed)
@jmeridth
jmeridth / visitor_pattern_tests_ruby_20081130_blogpost.rb
Created July 6, 2011 18:36
ruby tests for visitor pattern blog post
require ‘ruby.visitor’
describe EmployeePaycheckVisitor do
before do
@visitor = EmployeePaycheckVisitor.new
end
it “should generate hourly report for hourly employee” do
@jason = HourlyEmployee.new(“Jason”, 55.00)
@jason.addHoursWorked(120)
@jason.addSickDaysUsed(1)
@jason.addVacationDaysUsed(2)
@jmeridth
jmeridth / visitor_pattern_implementation_20081130_blogpost.cs
Created July 6, 2011 18:34
implementation for visitor pattern blog post
using System;
using System.Text;
namespace visitor.pattern
{
public abstract class Employee
{
protected int totalSickDaysUsed;
protected int totalVacationDaysUsed;
public abstract void accept(EmployeePaycheckVisitor visitor);
public void addSickDaysUsed(int numberOfDays)
@jmeridth
jmeridth / visitor_pattern_tests_20081130_blogpost.cs
Created July 6, 2011 18:33
tests for visitor pattern blog post
using NUnit.Framework;
using NUnit.Framework.SyntaxHelpers;
namespace visitor.pattern.specs
{
[TestFixture]
public class when_calculating_a_hourly_employees_wages
{
private HourlyEmployee jacob;
private EmployeePaycheckVisitor employeePaycheckVisitor;
[Test]
@jmeridth
jmeridth / ssh_config
Created June 30, 2011 04:10
config file for ssh
Host github.com
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa
Host github-blah
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_blah
CCTray 1.6
http://sourceforge.net/projects/ccnet/files/CruiseControl.NET%20Releases/CruiseControl.NET%201.6/CruiseControl.NET-CCTray-1.6.7981.1-Setup.exe/download
Custom HTTP URL
<TeamCity server>/guestAuth/app/cctray-standalone/cctray/projects.xml
#!/bin/bash
if [[ "$#" == 0 ]]; then
echo "Missing SHA1 arguments"
echo "usage: sh ./generate_marketing_zip.sh 389fc55 8dcdc7b b2048e0 304a791"
exit 1
fi
git archive -o ZipPrefix-`date +%Y%m%d`.zip HEAD $(git show --pretty="format:" --name-only $*)
echo "zip created successfully"
@jmeridth
jmeridth / gitsetup.txt
Last active September 25, 2015 11:58
the commands I run just after installing Git (autocrlf false)
git config --global user.name username
git config --global user.email myemailaddress@work.com
git config --global core.whitespace cr-at-eol
git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"
git config --global push.default tracking
git config --global branch.autosetuprebase always
git config --global help.autocorrect 1
git config --global core.autocrlf false