Skip to content

Instantly share code, notes, and snippets.

View double16's full-sized avatar

Patrick Double double16

View GitHub Profile
@p7cq
p7cq / Fedora_Root_On_ZFS.md
Last active August 2, 2023 05:04
Fedora with Root on ZFS - installation notes
@squarepegsys
squarepegsys / gvmup.sh
Created April 7, 2015 14:55
A handy little alias for Grails developers that support apps that could be one of many Grails versions
alias gvmup="gvm use grails `grep app.grails.version application.properties|gawk -F = '{print $2}'`"
@jeffsheets
jeffsheets / GroovySqlWithOutputsAndResultSetRows.groovy
Last active June 5, 2019 15:35
Extend Groovy Sql with callWithRows method to call a Stored Procedure and process both Output Parameters and Rows from the ResultSet in the closure handler.Could be replaced if http://jira.codehaus.org/browse/GROOVY-3048 is ever completed
SqlHelper sql = new SqlHelper(dataSource)
List results = sql.callWithRows("{call ABC.FINDBYLAST($lastName, ${Sql.INTEGER}, ${Sql.VARCHAR})}") {
List<GroovyRowResult> rows, int status, String errorMessage ->
if (status != 0) {
throw new RuntimeException("Error received from stored proc $status : $errorMessage")
}
return rows
}
@lukehefson
lukehefson / uninstall-GHfM.sh
Created November 27, 2013 13:48
Completely uninstall GitHub for Mac
#!/bin/bash
function remove_dir () {
rm -rf "$1_"
if [ -d "$1" ]
then
mv "$1" "$1_"
fi
}
@tvjames
tvjames / Vagrantfile
Last active August 11, 2022 14:27
Prepare a Windows Server 2008 R2 instance for use with vagrant-windows.
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
@kwilczynski
kwilczynski / cache.rb
Last active March 21, 2021 21:30
Simple Cache class in Ruby using pstore
#!/usr/bin/env ruby
class Cache
attr_reader :cache
class << self
def get(file, expiry, &block)
raise ArgumentError, 'no block given' unless block_given?
Cache.new(file, expiry, &block).cache
end
@mipmip
mipmip / gist:1844353
Created February 16, 2012 12:00
Mac OS X: restart mDNSResponder
Load up Terminal (Applications > Utilities > Terminal.app) and type the following.
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
To turn it back on, just do the opposite:
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist
@ikarius
ikarius / md5.groovy
Created February 9, 2010 09:57
How to generate a MD5 hash in Groovy ...
def generateMD5(String s) {
MessageDigest digest = MessageDigest.getInstance("MD5")
digest.update(s.bytes);
new BigInteger(1, digest.digest()).toString(16).padLeft(32, '0')
}