Skip to content

Instantly share code, notes, and snippets.

View ajmath's full-sized avatar

Andrew Matheny ajmath

  • Slack
  • Morgantown, WV
View GitHub Profile
@ajmath
ajmath / ConsoleJsonAppenderFactory.java
Last active August 19, 2022 19:11
Dropwizard Custom Appender
package io.github.ajmath;
import io.dropwizard.logging.AbstractAppenderFactory;
import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.contrib.jackson.JacksonJsonFormatter;
import ch.qos.logback.contrib.json.classic.JsonLayout;
import ch.qos.logback.core.Appender;
import ch.qos.logback.core.ConsoleAppender;
import ch.qos.logback.core.Layout;
@ajmath
ajmath / serverless.yml snippet
Last active May 13, 2019 23:02
serverless-plugin-typescript: Workaround for issue with excluding dev dependencies
package:
excludeDevDependencies: false
exclude: ${file(sls-exclude.js):get}
@ajmath
ajmath / Foo.java
Created July 23, 2017 19:03
Example of poor syntaxhighlighting of java
/*
foo
*/
public class Foo {
/*
Start of Foo
*/
public static void main(String[] args) {
@ajmath
ajmath / LICENSE
Created November 23, 2015 16:35 — forked from shevron/LICENSE
Send EC2 instance memory usage stats to CloudWatch using boto and IAM Roles
Copyright (c) 2015, Shahar Evron
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
//Overridden MKOverlayView method that draws the overlay to the MapView
- (void)drawMapRect:(MKMapRect)mapRect zoomScale:(MKZoomScale)zoomScale inContext:(CGContextRef)context
{
//Create CGPath to be rendered
CGMutablePathRef cgPath = CGPathCreateMutable();
CGPoint p1, p2, p3;
p1.x = -40;
p1.y = 20;
p2.x = 0.0;
### findDuplicatesInPath.ps1
### Andrew Matheny - andrew.j.matheny@gmail.com
###
### Powershell script that examines all exes in directories in the Path environment
### variable and prints a listing of duplicates and their respective paths.
$dirs = $Env:PATH.Split(';');
$exehash = @{};
foreach($d in $dirs)
@ajmath
ajmath / Too many functions?
Created September 13, 2010 20:51 — forked from abutcher/shBrushCommonLisp.js
added escape chars to funcs to work with regex. Changed comments regex
SyntaxHighlighter.brushes.CommonLisp = function()
{
var funcs = '\\* \\*\\* \\*\\*\\* \\+ \\+\\+ \\+\\+\\+ - / / // /// 1\\+ 1- \\< \\<= = \\> \\>= abort abs ' +
'acons acos acosh add-method adjoin adjust-array adjustable-array-p ' +
'alpha-char-p alphanumericp alter always and append append appending ' +
'apply applyhook \\*applyhook\\* apropos apropos-list aref arithmetic-error ' +
'arithmetic-error-operands arithmetic-error-operation array-dimension ' +
'array-dimension-limit array-dimensions array-element-type ' +
'array-has-fill-pointer-p array-in-bounds-p array-rank array-rank-limit ' +
'array-row-major-index array-total-size array-total-size-limit arrayp ' +
@ajmath
ajmath / example-mock
Created November 25, 2014 14:44
AWSENV Mocking
allow(AWSENV).to receive(:new).and_return(
double("env",
:hostname => "logstash-yup",
:instance_name => "lh-loststache",
:local_ipv4 => "10.0.0.1",
:public_ipv4 => "69.69.69.69",
:cf_stack_name => "SuperAwesomeStack",
:asg_name => "my_asg",
@ajmath
ajmath / keybase.md
Last active August 29, 2015 14:06
keybase.md

Keybase proof

I hereby claim:

  • I am ajmath on github.
  • I am ajmath (https://keybase.io/ajmath) on keybase.
  • I have a public key whose fingerprint is 1827 61B2 D7D6 AD66 FBCA 7237 A15B DAFE E35A 9D8D

To claim this, I am signing this object: