Skip to content

Instantly share code, notes, and snippets.

View ColinHarrington's full-sized avatar

Colin Harrington ColinHarrington

View GitHub Profile
@ColinHarrington
ColinHarrington / .gitconfig
Created January 18, 2012 17:37
git aliases
[alias]
st = status
ci = commit
br = branch
co = checkout
df = diff
lg = log -p
lol = log --graph --decorate --pretty=oneline --abbrev-commit
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
l = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
@ColinHarrington
ColinHarrington / gist:1388099
Created November 23, 2011 07:27
shouldFail Should Fail on unexpected Exception
void testShouldFailOnUnexpectedExceptionShouldFail() {
shouldFail {
shouldFail(MyException) {
throw new NullPointerException()
}
}
}
@ColinHarrington
ColinHarrington / gist:1078341
Created July 12, 2011 16:21 — forked from haydenmuhl/gist:1078293
Grails testing, error when using mockFor
Code:
class RepoControllerTests extends ControllerUnitTestCase {
protected void setUp() {
super.setUp()
}
protected void tearDown() {
super.tearDown()
}
$ ssh-keygen -t rsa -C "[email protected]"
Generating public/private rsa key pair.
Enter file in which to save the key (/home/<your_user>/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/<your_user>/.ssh/id_rsa.
Your public key has been saved in /home/<your_user>/.ssh/id_rsa.pub.
The key fingerprint is:
37:6c:6c:f3:a8:67:20:4f:94:b0:5b:85:fd:6c:8b:e1 [email protected]
The key's randomart image is:
@ColinHarrington
ColinHarrington / gist:880848
Created March 22, 2011 06:12
Linux/OSX Synergy Keymappings
section: screens
Linux:
OSX:
ctrl = ctrl
alt = meta
super = alt
end
section: links
Linux:
up = OSX
@ColinHarrington
ColinHarrington / git-cli-branch-a.sh
Created March 14, 2011 04:57
Show all local and remote branches
/demo/bookstore[master]$ git branch -a
* master
remotes/release-1.0
remotes/release-1.0.x
remotes/tags/releases
remotes/trunk
@ColinHarrington
ColinHarrington / BuildConfig.groovy
Created February 22, 2011 18:12
Build config for resolving HTTPBuilder - Not working
grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
//grails.project.war.file = "target/${appName}-${appVersion}.war"
grails.project.dependency.resolution = {
// inherit Grails' default dependencies
inherits("global") {
// uncomment to disable ehcache
// excludes 'ehcache'
}
@ColinHarrington
ColinHarrington / Exception
Created February 18, 2011 17:32
Grails Command Object Integration test failure
No signature of method: com.example.FooCommandBean.validate() is applicable for argument types: () values: [] Possible solutions: wait()
groovy.lang.MissingMethodException: No signature of method: com.example.FooCommandBean.validate() is applicable for argument types: () values: []
Possible solutions: wait()
at com.example.FooCommandBeanTests.testBar(FooCommandBeanTests.groovy:16)
https://github.com/ColinHarrington/Grails-Examples/blob/master/CommandIntegrationTest/test/integration/com/example/FooCommandBeanTests.groovy
int RED_PIN = 3;
int GREEN_PIN = 6;
int BLUE_PIN = 11;
int MAXSPEED = 255;
int SPEEDPAD = 80;
int tick = 1;
int rSpeed = 0;
int rval = 0;
int rGoal = 0;
$ arduino
java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver
Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1734)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1028)
at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:123)
at processing.app.Editor.populateSerialMenu(Editor.java:965)
at processing.app.Editor.buildToolsMenu(Editor.java:717)
at processing.app.Editor.buildMenuBar(Editor.java:502)