Skip to content

Instantly share code, notes, and snippets.

View gilday's full-sized avatar
🍕

Johnathan Gilday gilday

🍕
View GitHub Profile
@gilday
gilday / merge-repos.py
Last active January 26, 2023 16:20
utility script for merging repos into a monorepo while preserving history
#!/usr/bin/env python
# merge-repos.py
# utility script for merging repos into a monorepo while preserving history
import argparse
from contextlib import contextmanager
import os
import shutil
import subprocess
@gilday
gilday / likes.markdown
Created February 21, 2018 23:46
Things I like

Things I like

I am a grumpy developer. More than once, usually after I finish a diatribe on why some language or framework is a dumpster fire, I have been asked "so, what do you like?". I actually like a lot of things! Here's a list

Books

  • "Domain Driven Design" by Eric Evans: I came to discover the domain modeling persistence pattern while working on an ASP MVC application. The .NET community does a great job of furthering the discussion on best practices for domain modeling. Since, I have worked on too many Java code bases with anemic domain models. Each time I come across one of these code bases, I like to crack open "Domain Driven Design" again to refresh myself with Eric Evans' ideas on building an ubiquitous language using the domain model.
  • "Patterns of Enterprise Application Architecture" by Martin Fowler: the Gang of Four patterns are great for low-level design, but after reading Fowler's PoEAA I remember thinking "so thi
@gilday
gilday / mac.java
Created August 9, 2017 17:42
java retrieve a mac address
/**
* get local mac address as a string. useful for scheduling tasks to happen at the same time every day on a given machine, but at different times across all machines
*/
static String mac() {
final ArrayList<NetworkInterface> ifaces;
try {
ifaces = Collections.list(NetworkInterface.getNetworkInterfaces());
// sort the interfaces by name so we consistently pick the same interface
Collections.sort(ifaces, new Comparator<NetworkInterface>() {
@Override

Keybase proof

I hereby claim:

  • I am gilday on github.
  • I am gilday (https://keybase.io/gilday) on keybase.
  • I have a public key ASAViR_z1NtHfVbjgLeOBAhJPSjvBzUFsvwULnhsgb9Zewo

To claim this, I am signing this object:

@gilday
gilday / content__Dockerfile
Created September 23, 2016 01:10
data only container for static web content
FROM nginx
ADD ./index.html /usr/share/nginx/html/index.html
VOLUME /usr/share/nginx/html
@gilday
gilday / java-native-ssl.java
Last active August 29, 2015 14:03
Native Java SSL providers
// Windows
java.util.Properties props = new java.util.Properties();
props.setProperty("javax.net.ssl.keyStoreType", "Windows-MY");
props.setProperty("javax.net.ssl.keyStore", "NONE");
props.setProperty("javax.net.ssl.trustStoreType", "Windows-ROOT");
props.setProperty("javax.net.ssl.trustStore", "NONE");
// Apple (untested)
java.util.Properties props = new java.util.Properties();
props.setProperty("javax.net.ssl.keyStoreType", "KeychainStore");
@gilday
gilday / muddy7.rb
Last active December 14, 2015 22:29
JHU 605.421 response to Muddiest Point for module 7.
# JHU 605.421
# 03/14/2013
# Here's a response to your muddy question. This will run through the
# example given in the course material and trace out what is happening.
# Specifically, it traces the partition function
#
# Outputs
#
# p r
# [5, 3, 2, 6, 4, 1, 3, 7]
@gilday
gilday / assign-characters.m
Created December 1, 2012 02:32
Tim: this is how i assigned characters to everyone playing
-(ClueGameService*) initNewGameWithPlayers:(NSArray *)gkTurnBasedParticipants
{
self = [super init];
NSMutableArray *playersList = [[NSMutableArray alloc] initWithCapacity:[gkTurnBasedParticipants count]];
// The first player is always ms scarlet. don't care about the rest
NSArray *allCharacters = [[NSArray alloc] initWithObjects:[ClueCharacterFactory msScarlet], [ClueCharacterFactory colMustard], [ClueCharacterFactory mrsWhite], [ClueCharacterFactory profPlum] , nil];
for (int i = 0; i < [gkTurnBasedParticipants count]; i++) {
/// <summary>
/// Adds a model error using strongly typed lambda expressions
/// </summary>
public static void AddModelError<TModel>(
this ModelStateDictionary modelState,
Expression<Func<TModel, object>> method,
string message)
{
if (method == null)
{