Skip to content

Instantly share code, notes, and snippets.

View darrend's full-sized avatar
💻
Learning

Darren Day darrend

💻
Learning
  • Growth Acceleration Partners
  • Lexington, KY
  • 15:44 (UTC -05:00)
View GitHub Profile
@darrend
darrend / final_test_notification.png
Last active July 17, 2020 19:47
teeshout potential blog post
final_test_notification.png
@darrend
darrend / bashtricks.markdown
Created October 28, 2015 17:35
bash tricks
yell() { echo "$0: $*" >&2; }
die() { yell "$*"; exit 111; }
try() { "$@" || die "cannot $*"; }
scriptdir() { (cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd) }
@darrend
darrend / ApplicationPropertyEntity.java
Last active August 29, 2015 14:26
playing around with java 8 and application properties
package us.copperdays.snippets.applicationproperty.demo;
import javax.persistence.*;
@Entity
@Table(name = "APP_PROPS", schema = "DEMO")
public class ApplicationPropertyEntity {
@Id
@Column(name = "KEY")
private String key;
@darrend
darrend / color.md
Last active August 29, 2015 14:01
color.md

Berlin and Kay also found that, in languages with fewer than the maximum eleven color categories, the colors found in these languages followed a specific evolutionary pattern. This pattern is as follows:

  • All languages contain terms for black and white.
  • If a language contains three terms, then it contains a term for red.
  • If a language contains four terms, then it contains a term for either green or yellow (but not both).
  • If a language contains five terms, then it contains terms for both green and yellow.
  • If a language contains six terms, then it contains a term for blue.
  • If a language contains seven terms, then it contains a term for brown.
  • If a language contains eight or more terms, then it contains a term for purple, pink, orange, and/or gray.

Keybase proof

I hereby claim:

  • I am darrend on github.
  • I am darrenbday (https://keybase.io/darrenbday) on keybase.
  • I have a public key whose fingerprint is 0A46 46A2 65E1 6B72 1F09 3BD2 0605 E3A0 0911 2AF5

To claim this, I am signing this object:

@darrend
darrend / FlagArgumentsDemo.java
Last active August 29, 2015 13:57
noodling with flag parameters to methods instead of a buncha booleans
import java.util.Arrays;
public class FlagArgumentsDemo {
public static void main(String[] args) {
System.out.println(convertToInteger("5"));
System.out.println(convertToInteger("5", Flag.DEBUG));
System.out.println(convertToInteger("5", Flag.IGNORE_EXCEPTIONS, Flag.DEBUG));
System.out.println(convertToInteger("no number", Flag.IGNORE_EXCEPTIONS, Flag.DEBUG));
System.out.println(convertToInteger("no number", Flag.IGNORE_EXCEPTIONS));
try {
@darrend
darrend / kill_unattached_mosh_servers.sh
Last active August 29, 2015 13:56
kill unattached mosh sessions
ps -e | grep "mosh-server" | grep -v "^$PPID" | awk '{print $1}' | xargs -r --verbose kill -TERM
package scripts.rest
def values = [:]
params.each { name, value -> values[name] = value }
headers.each { name, value -> values[name] = value }
cookies.each { name, value -> values[name] = value }
sessionAttributes.each { name, value -> values[name] = value }
return values
@darrend
darrend / counterwithlambda.rb
Last active December 24, 2015 16:58
Is there a tighter way to do this?
num_fragments = 0
counter = lambda { num_fragments += 1 }
/* Author: Darren Day
*/
function handleResponse(data) {
var source = $("#template").html();
var template = Handlebars.compile(source);
var result = template({
"links": data
});
$("#main").append(result);