Skip to content

Instantly share code, notes, and snippets.

View jarrad's full-sized avatar

jarrad jarrad

  • NC
View GitHub Profile
@jarrad
jarrad / jvmFlags.sh
Created February 11, 2015 14:09
List available JVM flags
java -XX:+PrintFlagsFinal
@jarrad
jarrad / log.template
Created February 4, 2015 18:24
Eclipse slf4j logger template. Create a Logger for the current class and import the slf4j classes.
${:import(org.slf4j.Logger, org.slf4j.LoggerFactory)}
private static final Logger log = LoggerFactory.getLogger(${enclosing_type}.class);
@jarrad
jarrad / devise.rb
Last active January 1, 2016 15:49
Needed to extend Devise to integrate and authenticate with a legacy app. Stitched this solution together after reading multiple articles and trying various combinations therein.
# config/initializers/devise.rb
require 'devise/models/remote_authenticatable'
require 'remote_auth_strategy'
Devise.setup do |config|
# all the other shenanigans...
config.warden do |manager|
manager.intercept_401 = false
manager.default_strategies(:scope => :user).unshift :remote
@jarrad
jarrad / .bashrc
Created January 17, 2013 15:36
Shell Prompt with current git branch
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ \(\1\)/'
}
function cli {
local BLUE="\[\033[0;34m\]"