Skip to content

Instantly share code, notes, and snippets.

View danthegoodman's full-sized avatar
™️

Danny Kirchmeier danthegoodman

™️
View GitHub Profile
@danthegoodman
danthegoodman / _Events.groovy
Last active September 14, 2016 13:35
Desktop Notification on Grails Start, Test Complete
// Save in ~/.grails/scripts/_Events.groovy
def start = new Date();
eventStatusFinal = { msg ->
if(msg.startsWith("Server running.")) {
println 'Startup time = ' + timeDiff(start)
notification("Grails Started")
}
}
eventTestPhasesEnd = {
@danthegoodman
danthegoodman / printECS.sh
Created May 8, 2013 04:16
Shell command to print a file to a room in the ECS building at Baylor University. It hasn't been tested since 2011, so room numbers may be out of sync or the command may not work. Use at your own risk.
#!/bin/bash
# Usage: printECS ROOM FILE
# Prints to a room in the Rodgers building
ECS_LOGIN=bobbybear@wind.ecs.baylor.edu
case $1 in
214);;
113);;
112);;
@danthegoodman
danthegoodman / alert.sh
Last active September 2, 2016 21:47
iTerm niceties for bash
# Sends a message to growl from the terminal
#
# Usage: alert <text>
# Result: Growl notification with text
#
# Example: sleep 10 ; alert 'I am awake'
alert() { echo -e $'\e]9;'${@}'\007' ; }

Problem

You have two files - names.txt and characters.txt.

The characters.txt file contains all the characters needed to spell two names from the names.txt file.

When the correct names are found:

  • Every character from characters.txt will be used exactly once
  • There will be no unused characters
@danthegoodman
danthegoodman / private.xml
Created August 15, 2014 14:33
Karabiner Settings
<?xml version="1.0"?>
<root>
<devicevendordef>
<vendorname>ACER</vendorname>
<vendorid>0x04ca</vendorid>
</devicevendordef>
<deviceproductdef>
<productname>ACER_KEYBOARD_WITH_VOLUME_SPINNER</productname>
<productid>0x0024</productid>
@danthegoodman
danthegoodman / profile.sh
Last active February 24, 2017 14:44
profile.sh
###### Environment Configuration
export GREP_OPTIONS='--color=auto'
export GRAILS_OPTS='-Djava.awt.headless=true -server -Xmx512m -XX:MaxPermSize=256m -XX:+UseConcMarkSweepGC -XX:+UseCompressedOops'
export GRADLE_OPTS='-Dorg.gradle.daemon=false'
export HOMEBREW_CASK_OPTS='--appdir=~/Applications/casks'
export PGUSER='ids_dev'
export CLICOLOR=1
export LESS='--quit-if-one-screen --RAW-CONTROL-CHARS --no-init --tabs=4'
export LS_COLORS=GxFxCxDxBxegedabagaced
export TREE_COLORS='di=1;36:ln=1;35:so=1;32:pi=1;33:ex=1;31:bd=34;46:cd=34;33:fi=0:or=4;31'
$IS_MINE:0
$TRIGGER_LEVEL:1
once
TRUE SetPopupTextAlwaysVisible
0 SetPopupTextY
Self "main" "NONE" SetImage
Self CONST_CELLHEIGHT 1 SetUnitAttribute
Self CONST_CELLWIDTH 1 SetUnitAttribute
@danthegoodman
danthegoodman / AppTest.java
Created October 7, 2016 16:33
Ratpack SNI Workaround
import ratpack.http.client.HttpClient;
import ratpack.test.embed.EmbeddedApp;
import javax.net.ssl.SniSslContext;
import java.net.URI;
class AppTest {
static void main(String[] args) throws Exception {
EmbeddedApp.fromHandler(ctx -> {
URI uri = URI.create("#### A URL POINTING TO A SERVER USING SNI SSL ####");
@danthegoodman
danthegoodman / .bashrc
Last active November 9, 2016 22:19
git-cd
# git change directory
gcd() {
local gitdir result
gitdir=$(git rev-parse --show-toplevel 2>/dev/null)
[[ -z "$gitdir" ]] && echo "[not a git directory]" && return 1
result=$(gfind "$gitdir" -type d -not -path '*/\.*' -printf '/%P\n' | fzf --reverse --no-sort)
[[ -z "$result" ]] && return 1
cd "${gitdir}${result}"
}
@danthegoodman
danthegoodman / error.txt
Created May 26, 2017 16:05
npm error report
Unhandled rejection Error: Argument #2: Expected string but got null5
at addDependency (/usr/local/lib/node_modules/npm/lib/install/deps.js:515:3)
at /usr/local/lib/node_modules/npm/lib/install/deps.js:463:5
at /usr/local/lib/node_modules/npm/node_modules/slide/lib/async-map.js:52:35
at Array.forEach (native)
at /usr/local/lib/node_modules/npm/node_modules/slide/lib/async-map.js:52:11
at Array.forEach (native)
at asyncMap (/usr/local/lib/node_modules/npm/node_modules/slide/lib/async-map.js:51:8)
at loadDeps (/usr/local/lib/node_modules/npm/lib/install/deps.js:455:3)
at Array.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/slide/lib/bind-actor.js:15:8)