Skip to content

Instantly share code, notes, and snippets.

@jredh
jredh / gradle dependency detection
Created June 1, 2018 19:47
how to detect that somehow we're pulling in some whacky version of es
./gradlew dependencies
./gradlew dependencyInsight --dependency org.elasticsearch:elasticsearch
@jredh
jredh / prepare-commit-msg
Created March 23, 2018 16:43
This prepends all commits with the branch name
# ~/.githooks/prepare-commit-msg
if [ -z "$BRANCHES_TO_SKIP" ]; then
BRANCHES_TO_SKIP=(master continuous dev test)
fi
BRANCH_NAME=$(git symbolic-ref --short HEAD)
BRANCH_NAME="${BRANCH_NAME##*/}"
BRANCH_EXCLUDED=$(printf "%s\n" "${BRANCHES_TO_SKIP[@]}" | grep -c "^$BRANCH_NAME$")
mkdir ~/.githooks/
touch ~/.githooks/prepare-commit-msg
git config --global core.hooksPath ~/.githooks/
chmod a+x ~/.githooks/*
{{ $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" }}
{{ $.Scratch.Add "path" .Site.BaseURL }}
<ol class="breadcrumbs">
<li><a href="/">home</a></li>
{{ range $index, $element := split $url "/" }}
{{ $.Scratch.Add "path" $element }}
{{ if ne $element "" }}
<li><a href='{{ $.Scratch.Get "path" }}'>{{ . }}</a></li>
{{ $.Scratch.Add "path" "/" }}
{{ end }}
@jredh
jredh / bad-comma.scala
Last active November 13, 2017 22:58
This is invalid Scala: the final comma is sometimes overlooked when going through. When you delete an argument, etc. you can overlook this.
def method(
a : Int,
b : String,
c : List[Integer],
d : Object,
e : String,
)
@jredh
jredh / comma-standard.scala
Last active November 13, 2017 22:56
Case for commas at the start of multi-line method calls.
// Figure A
def method (
a : Int,
b : Object,
c : List[Integer]
d : String,
e : String,
f : Int
) = { ... }
trait Talkative {def greeting: String}
trait English extends Talkative {
override def greeting(): String = "Hello!"
}
trait German extends Talkative {
override def greeting(): String = "Guten Tag!"
}
trait Moving {
var x = 0
var y = 0
}
trait Flying extends Moving {
def fly(): Unit = {
y = 1
x += 1
}
@jredh
jredh / about.md
Last active June 13, 2017 17:40 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
require('GlobalStrings')
-- generated from s_bonusStatStringTags
local bonusStats = {
[0] = "ITEM_MOD_MANA_SHORT",
[1] = "ITEM_MOD_HEALTH_SHORT",
[3] = "ITEM_MOD_AGILITY_SHORT",
[4] = "ITEM_MOD_STRENGTH_SHORT",
[5] = "ITEM_MOD_INTELLECT_SHORT",
[6] = "ITEM_MOD_SPIRIT_SHORT",