Skip to content

Instantly share code, notes, and snippets.

View devinsba's full-sized avatar

Brian Devins devinsba

  • Liberty Mutual
View GitHub Profile
@codefromthecrypt
codefromthecrypt / gist:7180c278b62e8f6a216a2aea45d08fc9
Created March 3, 2017 08:54
aggregation for binary annotations
# this returns all of the annotation values, not just the http.url
# for more.. https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html
curl -s 'localhost:9200/zipkin-*/span/_search' -d'{
"_source": false,
"aggs": {
"binaryAnnotations": {
"nested": {
"path": "binaryAnnotations"
},
"aggs" : {
@lewisd32
lewisd32 / iptableflip.sh
Created April 15, 2015 18:20
Snippet of Unbounce script for restarting HAProxy with zero downtime
echo "Flipping tables! (╯°□°)╯︵ ┻━┻"
num_rules=3
real=3 # exposed to the ELB as port 443
test=4 # used to install test certs for domain verification
health=5 # used by the ELB healthcheck
blue_prefix=855
green_prefix=866
@vijaykramesh
vijaykramesh / newrelic_transaction_naming.java
Last active August 29, 2015 14:02
NewRelic transaction naming for Dropwizard
public class TimedResourceMethodDispatchProvider implements ResourceMethodDispatchProvider {
final ResourceMethodDispatchProvider provider;
public TimedResourceMethodDispatchProvider(ResourceMethodDispatchProvider provider) {
this.provider = provider;
}
@Override
public RequestDispatcher create(AbstractResourceMethod abstractResourceMethod) {
RequestDispatcher dispatcher = provider.create(abstractResourceMethod);
@joshuakenzo
joshuakenzo / slidingpuzzle.py
Created October 16, 2011 17:24
A* sliding puzzle solver
# -*- coding: utf-8 -*-
"""
Solver script for the fifteen-puzzle and derivations of it (8-puzzle etc.),
based on what we've learnt on ai-class.com so far. Don't expect it to run very
fast, certain puzzle states take ages to solve. I have documented and
commented the code thoroughly, so hopefully it's easy to understand what's
going on.
Written by Håvard Pettersson. Released into the public domain.
:+1:
:-1:
:airplane:
:art:
:bear:
:beer:
:bike:
:bomb:
:book:
:bulb: