Skip to content

Instantly share code, notes, and snippets.

View davidkuster's full-sized avatar

David Kuster davidkuster

View GitHub Profile
@davidkuster
davidkuster / BuildConfig.groovy
Last active August 29, 2015 13:56
Grails BuildConfig.groovy - exclude console plugin from prod env
import grails.util.Environment
// don't include console plugin in prod
if ( Environment.current != Environment.PRODUCTION ) {
compile ":console:1.3"
}
@davidkuster
davidkuster / sublime_key_bindings.json
Last active August 29, 2015 13:56
Sublime Text 2 - Key Bindings (Preferences -> Key Bindings - User)
[
{ "keys": ["ctrl+b"], "command": "toggle_side_bar" },
// shortcuts for home and end keys because of the 6 row lenovo keyboard layout
{ "keys": ["ctrl+,"], "command": "move_to", "args": {"to": "bol", "extend": false} },
{ "keys": ["ctrl+."], "command": "move_to", "args": {"to": "eol", "extend": false} },
// shift shortcuts to select text with home & end shortcuts
{ "keys": ["shift+ctrl+,"], "command": "move_to", "args": {"to": "bol", "extend": true} },
{ "keys": ["shift+ctrl+."], "command": "move_to", "args": {"to": "eol", "extend": true} },
@davidkuster
davidkuster / sublime_user_settings.json
Last active September 4, 2015 15:16
Sublime Text 2 - User Settings (Preferences -> Settings - User)
{
"auto_complete_commit_on_tab": true,
"auto_complete_selector": "source, comment, text",
"caret_style": "solid",
"color_scheme": "Packages/Color Scheme - Default/Sunburst.tmTheme",
"detect_indentation": true,
"draw_minimap_border": true,
"find_selected_text": true,
"file_exclude_patterns":
[
@davidkuster
davidkuster / sublime_dirty_tabs.json
Last active August 29, 2015 13:56
Sublime Text 2 - dirty tabs tweak
/*************************************************************
Patch for highlight_modified_tabs
This tweak will make your modified tabs much more visible by setting them to a dark/purple-ish
background. Make a backup of your existing Default.sublime-theme first, and it's usually
necessary to reapply this patch after installing an updated version of ST2. Note that this
should work regardless of whether you have a dark or light theme in use.
This is done in the default Sublime theme, found at C:\Documents and Settings\username\
@davidkuster
davidkuster / Coda.tmTheme
Created February 6, 2014 22:53
Sublime Text 2 - Coda theme (/home/user/.config/sublime-text-2/Packages/Color Scheme - Default/Coda.tmTheme)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Coda</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
@davidkuster
davidkuster / .slate.js
Last active March 7, 2017 21:36
Slate JS config
// slate javascript config
// global configs
slate.log("-- setting up global configs --");
slate.configAll({
defaultToCurrentScreen: false,
orderScreensLeftToRight: true,
checkDefaultsOnLoad: true,
nudgePercentOf: "screenSize",
@davidkuster
davidkuster / .bash_aliases
Created December 30, 2014 13:56
bash aliases
# directory shortcuts
alias home='cd ~'
alias work='cd ~/workspace'
alias proj='cd ~/projects'
alias doc='cd ~/Documents'
alias down = 'cd ~/Downloads'
# navigation shortcuts
alias ..='cd ..'
alias ..2='cd ../..'
@davidkuster
davidkuster / fib.groovy
Created August 5, 2015 15:09
Tail Recursive Fibonacci
// Single stack frame. Returns the "Nth" Fibonacci number - aka the Nth number in the sequence.
def fibIter
fibIter = { int step, int endStep, long currVal, long nextVal ->
if ( step == endStep ) return currVal
fibIter.trampoline( ++step, endStep, nextVal, currVal+nextVal )
}.trampoline()
def fibonacci = { int seqNum ->
if ( seqNum < 0 ) println "fail" // needs better error handling
@davidkuster
davidkuster / singlyLinkedList.groovy
Created August 5, 2015 15:38
Reversing a Singly Linked List
// comparing my thoughts on how to answer this common question, vs what was found at the following link:
// http://www.programmerinterview.com/index.php/data-structures/reverse-a-linked-list/
// In the link above, the recursive solution works in an interview to prove you can think recursively,
// but doesn't work in a real-world scenario because it's prone to stack overflow errors.
class Node {
Node next
Integer i
String toString() { i as String }
@davidkuster
davidkuster / .bash_profile
Last active July 17, 2020 03:13
OSX bash profile
# history tweaks (Setting HISTSIZE and HISTFILESIZE to something nonnumeric makes for no limits)
export HISTFILESIZE="SAVE_IT_ALL_YO"
export HISTSIZE="SAVE_IT_ALL_YO"
export HISTTIMEFORMAT='%Y-%m-%d %H:%M.%S | '
export HISTIGNORE="ll:exit:history:[bf]g:jobs"
export HISTCONTROL=ignorespace
shopt -s histappend
# think about separating out history files
#export HISTFILE="${HOME}/.history/$(date -u +%Y/%m/%d.%H.%M.%S)_${HOSTNAME}_$$"