Skip to content

Instantly share code, notes, and snippets.

@nnutter
nnutter / about.md
Created August 27, 2011 17:28 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
@nnutter
nnutter / post-receive.sh
Created June 24, 2012 06:26
Git Post-Receive Hook to Deploy Code to a Working Directory
#!/bin/sh
read OLDREV NEWREV REFNAME
BRANCHNAME=${REFNAME#refs/heads/}
export GIT_WORK_TREE=$HOME/deploy/genome/$BRANCHNAME
mkdir -p $GIT_WORK_TREE
echo "Deploying to $GIT_WORK_TREE..."
/usr/bin/git checkout -f $BRANCHNAME
echo "Deploy done."
@nnutter
nnutter / toTitleCase.js
Created June 24, 2012 06:28
Bookmarklet-Ready Code to Title Case Selected Text
// Ported to JavaScript By John Resig - http://ejohn.org/ - 21 May 2008
// Original by John Gruber - http://daringfireball.net/2008/05/title_case - 10 May 2008
// License: http://www.opensource.org/licenses/mit-license.php
function toTitleCase(title){
var small = "(a|an|and|as|at|but|by|en|for|if|in|of|on|or|the|to|v[.]?|via|vs[.]?)";
var punct = "([!\"#$%&'()*+,./:;<=>?@[\\\\\\]^_`{|}~-]*)";
var parts = [], split = /[:.;?!] |(?: |^)["Ò]/g, index = 0;
while (true) {
@nnutter
nnutter / send_to_kindle.sh
Created August 5, 2012 01:43
Send to Kindle - Service
for PATH in "$@"; do
FILE="$(basename "$path")"
SUBJECT="${FILE%.*}"
/usr/local/bin/mutt -a "$PATH" -s "$SUBJECT" -- $KINDLE_EMAIL < /dev/null
done
@nnutter
nnutter / .muttrc
Created August 5, 2012 01:58
.muttrc
set folder="~/Library/Application Support/mutt"
set record="+sent"
set mbox_type=Maildir
@nnutter
nnutter / perl-extract-method
Last active December 19, 2015 03:28
Reads in Perl code and parses compile errors to determine which variables need to be passed in so that you can use it as an Extract Method refactoring tool. Based on Jesse Vincent's: http://fsck.com/~jesse/extract
#!/usr/bin/env perl
# 1) Drop in your path and make it executable.
# 2) Add a map in your vimrc like:
# vnoremap <leader>sub :! perl-extract-method<CR>
use warnings;
use strict;
use IO::File qw();
diff --git a/github-oauth/pom.xml b/github-oauth/pom.xml
index f3acf76..9310483 100644
--- a/github-oauth/pom.xml
+++ b/github-oauth/pom.xml
@@ -65,7 +65,7 @@ limitations under the License.
<dependency>
<groupId>com.google.gerrit</groupId>
<artifactId>gerrit-plugin-api</artifactId>
- <version>${project.version}</version>
+ <version>2.8</version>
$ mvn install -U
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.googlesource.gerrit.plugins.github:github-plugin:jar:2.8-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: javax.servlet:javax.servlet-api:jar -> duplicate declaration of version 3.0.1 @ line 147, column 17
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
$ git log --oneline -n 1
f95fcd3 Uniform "Next" step action button with other screns.
$ git diff
diff --git a/github-oauth/pom.xml b/github-oauth/pom.xml
index f3acf76..9310483 100644
--- a/github-oauth/pom.xml
+++ b/github-oauth/pom.xml
@@ -65,7 +65,7 @@ limitations under the License.
<dependency>
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project github-plugin: Compilation failure: Compilation failure:
[ERROR] /home/vagrant/github/github-plugin/src/main/java/com/googlesrouce/gerrit/plugins/github/git/PullRequestCreateChange.java:[217,8] error: no suitable constructor found for Change(Key,com.google.gerrit.reviewdb.client.Change.Id,com.google.gerrit.reviewdb.client.Account.Id,NameKey)
[ERROR] constructor Change.Change(Key,com.google.gerrit.reviewdb.client.Change.Id,com.google.gerrit.reviewdb.client.Account.Id,NameKey,Timestamp) is not applicable
[ERROR] (actual and formal argument lists differ in length)
[ERROR] constructor Change.Change() is not applicable
[ERROR] (actual and formal argument lists differ in length)
[ERROR] /home/vagrant/github/github-plugin/src/main/java/com/googlesrouce/gerrit/plugins/github/git/PullRequestCreateChange.java:[269,8] error: no suitable constructor found for ChangeMessage(Key,com.google.gerrit.reviewd