Skip to content

Instantly share code, notes, and snippets.

View willis7's full-sized avatar
🏠
Working from home

Sion Williams willis7

🏠
Working from home
View GitHub Profile
@willis7
willis7 / AbstractFactory.groovy
Last active August 29, 2015 13:55
Implementation of the abstract factory in Groovy
class Book {
String title
int pages
}
class CD {
String title
int volume
}

Open TortoiseGit > Settings, and click on Diff Viewer.

Under the Configure the program used for comparing different revisions of files section, select External, and add the following into the text box.

WinMergeU.exe /r /e /x /u /wl %base %mine

Click on Merge Tool to the left, select External, enter the following.

/* Groovy Usage:
The following example replaces:
the 1st occurrence of "James" in data.txt with "user1",
the 2nd occurrence of "James" in data.txt with "user2",
the 3rd occurrence of "James" in data.txt with "user3",
..
the 9th occurrence of "James" in data.txt with "user9".
*/
def myFile = new File("data.txt")
buildscript {
apply plugin: 'groovy'
dependencies {
gradleApi()
}
}
ext{
earDir = "${projectDir}/src/dist"
@willis7
willis7 / gist:f99eb65a2bbd2fb7875a
Created October 13, 2014 20:30
Install Google Chrome on Linux
$ wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - && \
$ sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && \
$ sudo apt-get update && \
$ sudo apt-get install google-chrome-stable
@willis7
willis7 / jdk8_ubuntu
Created November 2, 2014 20:00
Install Oracle Java JDK 1.8 on Ubuntu
# sudo -i
then enter your password
# add-apt-repository ppa:webupd8team/java
# apt-get update
# apt-get install oracle-java8-installer
@willis7
willis7 / intellij-idea_ubuntu
Last active August 29, 2015 14:08
Install intellij on Ubuntu or Xubuntu
Become root.
# sudo -i
then enter your password
Extract ideaIC-XX.Y.Z.tar.gz using
# tar -zxvf ideaIC-XX.Y.Z.tar.gz
Move the extracted folder to /opt/idea
# mv ideaIC-XX.Y.Z /opt/idea
@willis7
willis7 / local-update-paranoid
Created November 17, 2014 22:46
Local flags for Git security
# no rewriting history
denyNonFastForwards = true
# no deleting history
denyDeletes = true
# check object consistency
fsckObjects = true
@willis7
willis7 / update-paranoid
Created November 17, 2014 22:48
Git hook for remote based security
#!/usr/bin/perl
use strict;
use File::Spec;
$ENV{PATH} = '/opt/git/bin';
my $acl_git = '/vcs/acls.git';
my $acl_branch = 'refs/heads/master';
my $debug = 0;
@willis7
willis7 / maven-regex
Created December 10, 2014 17:09
A regex for picking out Maven jars with 3 point fix numbers
.*-[0-9]\.[0-9]\.[0-9]-?(SNAPSHOT)?\.jar