Skip to content

Instantly share code, notes, and snippets.

@matthewmccullough
matthewmccullough / gist:48058
Created January 16, 2009 18:55 — forked from halbtuerke/gist:31934
Windows (Cygwin) Show Git dirty status in your Unix bash prompt
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[0;34m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
WHITE="\[\033[1;37m\]"
LIGHT_GRAY="\[\033[0;37m\]"
COLOR_NONE="\[\e[0m\]"
@matthewmccullough
matthewmccullough / gist:988077
Created May 24, 2011 03:02
Visualize Git Orphans via gitk and log
# Put this in your .gitconfig file under the alias section
orphank = !gitk --all `git reflog | cut -c1-7`&
# Then run it by typing 'git orphank' on the command line.
# A text version of the same is
orphanl = !git --pretty=oneline --abbrev-commit --graph --decorate `git reflog | cut -c1-7`
@berinle
berinle / .gitignore_global
Created June 22, 2011 14:10
Global .gitignore to apply for all projects
# Add the contents of this file to ~/.gitignore_global
# Also, run 'git config --global core.excludesfile ~/.gitignore_global' on the machine or else it wouldn't be picked up!
# Reference http://help.github.com/ignore-files/
# Compiled source #
###################
*.com
*.class
@benjaminmateev
benjaminmateev / gist:1125355
Created August 4, 2011 14:55
jQuery UI Autocomplete in Coffeescript
$ ->
$('#header_search').autocomplete
source: "/search/autocomplete"
formatItem: (item) ->
"<img src=\"#{item.url}\" />#{item.title}"
select: (event, ui) ->
location.href = ui.item.href
@defunkt
defunkt / gitio
Created September 11, 2011 08:11
Turn a github.com URL into a git.io URL.
#!/usr/bin/env ruby
# Usage: gitio URL [CODE]
#
# Turns a github.com URL
# into a git.io URL
#
# Copies the git.io URL to your clipboard.
url = ARGV[0]
code = ARGV[1]
@Dierk
Dierk / build.gradle
Created October 7, 2011 22:43
build.gradle for setting up a new gradle-based project
apply plugin:'groovy'
apply plugin:'idea'
repositories { mavenCentral() }
dependencies {
groovy 'org.codehaus.groovy:groovy-all:1.8.2'
}
task makeDirs(description:'make all dirs for project setup') << {
@berinle
berinle / gist:1487328
Created December 16, 2011 18:38
Textmate 2 (custom bundles)
cd ~/Library/Application\ Support
mkdir -p Avian/"Pristine Copy"/Bundles
cd Avian/Pristine\ Copy/Bundles
#clone groovy bundle
git clone https://github.com/textmate/groovy.tmbundle.git
#clone grails bundle
git clone https://github.com/textmate/groovy-grails.tmbundle.git
@berinle
berinle / gist:1760796
Created February 7, 2012 17:16
Git tips: creating and applying a patch avoiding white space issues
#create a commit patch, ignoring all white space issues
g format-patch -w -b --ignore-space-at-eol -o /my/patch/destination -1
#apply a patch, ignoring all white space issues
g am --ignore-space-change --ignore-whitespace --whitespace=nowarn
@jackganzha
jackganzha / ModelTest.java
Created February 20, 2012 03:19
A super class for model tests in play 2.0
package models;
import java.util.Map;
import java.util.List;
import java.util.ArrayList;
import org.junit.Test;
import org.junit.After;
import org.junit.Before;
import org.junit.Assert;
@ys16
ys16 / plugins.sbt
Created April 1, 2012 18:19 — forked from seratch/plugins.sbt
Play20's project/plugins.sbt for IntelliJ IDEA users
// Comment to get more information during initialization
logLevel := Level.Warn
// The Typesafe repository
resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"
// Use the Play sbt plugin for Play projects
addSbtPlugin("play" % "sbt-plugin" % "2.0")
resolvers += "sbt-idea-repo" at "http://mpeltonen.github.com/maven/"