Skip to content

Instantly share code, notes, and snippets.

View thecodesmith's full-sized avatar

Brian Stewart thecodesmith

  • Jamf
  • United States
View GitHub Profile

Notes on Advanced GORM - Burt Beckwith on infoq.com

GORM Collections

Don't use collections (for large collections) Instead of using GORM collections:

class Library {
    String name

static hasMany = [visits: Visit]

@thecodesmith
thecodesmith / docker-dns.sh
Created July 23, 2015 19:39
Docker DNS/connectivity fix when docker running on Virtualbox (Ubuntu 14.04) host
# Get DNS server names
nm-tool | grep DNS
# Add one or more of the above IPs to the docker config:
# DOCKER_OPTS="--dns 8.8.8.8 ... --dns <local DNS server IP>"
vi /etc/default/docker
#!/usr/bin/env bash
# Run this command first to allow downloading of bootstrap script:
# sudo apt-get install curl
# curl https://gist.githubusercontent.com/thecodesmith/256c0bca7ad7e88f509a/raw/163665eefb90f986fb47fb4cec0006105577ee69/bootstrap.sh -o bootstrap.sh
sudo apt-get update
sudo apt-get -y install xsel
sudo apt-get -y install git
@thecodesmith
thecodesmith / grails_opts
Last active August 29, 2015 14:18
Grails 3.0 bad <init> method call error fix
Creating a Grails app and calling run-app yields this error:
ERROR grails.boot.GrailsApp - Application startup failed
java.lang.VerifyError: Bad <init> method call from inside of a branch
Exception Details:
Location:
grails/web/mime/MimeType.<init>(Ljava/lang/String;)V @119: invokespecial
Reason:
Error exists in the bytecode
Bytecode:
@thecodesmith
thecodesmith / BeanImpl.groovy
Last active August 29, 2015 14:07
Spring Boot Groovy dataSource injection
import javax.sql.DataSource
import groovy.sql.Sql
class BeanImpl {
// Setter injection
Sql sql
// Constructor injection
BeanImpl(DataSource dataSource) {
@thecodesmith
thecodesmith / ssh_setup
Created September 2, 2014 21:34
Useful SSH configuration setup commands
# Generate new ssh key
ssh-keygen -t rsa
# Copy public key to remote server
cat ~/.ssh/id_rsa.pub | ssh user@hostname 'cat >> .ssh/authorized_keys'
@thecodesmith
thecodesmith / inputrc
Created August 30, 2014 17:57
Bash Case-insensitive Autocomplete
# Put this in /etc/inputrc
set completion-ignore-case on
@thecodesmith
thecodesmith / .gitconfig
Created August 23, 2014 18:13
Default Git Configuration
[user]
name = Brian Stewart
email = brian@...
[push]
default = simple
[alias]
co = checkout
ci = commit
@thecodesmith
thecodesmith / config
Last active August 29, 2015 14:05
Basic SSH config file and usage
# Notes:
# Port field not required, defaults to 22
# IdentityFile field not required, defaults to ~/.ssh/id_rsa
Host github
User git
HostName github.com
IdentityFile ~/.ssh/id_rsa
Host laptop
@thecodesmith
thecodesmith / RabbitMQ Server Setup
Created August 20, 2014 17:56
Set up local RabbitMQ server
Download RabbitMQ Server:
https://www.rabbitmq.com/download.html
Install RabbitMQ Server. The server will start automatically with default settings.
Default settings for publishing/consuming:
username: 'guest'
password: 'guest'