Skip to content

Instantly share code, notes, and snippets.

View spazm's full-sized avatar

Andrew Grangaard spazm

View GitHub Profile
# wrapper around aws s3 to simpllify get/put of secure resources from our s3 bucket.
AWS:= aws
S3:=s3://secure.example.com
S3PATH:=/
FILE=secure.conf
REMOTE=${S3}${S3PATH}${FILE}
help:
@spazm
spazm / post-checkout
Created June 24, 2015 21:01
.git/hooks/post-checkout for logging branch changes. Will mine this to see what sort of frecency map would be useful for finding "hot" branches
#!/bin/sh
previous_head_ref=$1
new_head_ref=$2
is_branch_checkout=$3
if [[ "$previous_head_ref" != "$new_head_ref" ]] && [[ "$is_branch_checkout" == 1 ]]; then
branch=$(git rev-parse --abbrev-ref HEAD)
#if [[ "develop" != "$branch" ]]; then
path="$(dirname "$0")/.."
#!/usr/bin/perl
use strict;
use warnings;
use JIRA::Client;
use Text::CSV;
my $user = 'jirauser';
my $password = 'jirapass';
use Test::More;
#use Secret::Object;
#use Secret::Message;
BEGIN { use_ok('Secret::Object') };
BEGIN { use_ok('Secret::Message') };
my %attrs_for_object1 = ();
my %attrs_for_object2 = ();
#!/bin/sh
shift 5;
vimdiff -f "$@"
#!/bin/bash
#
# By Andrew Grangaard ( http://www.lowlevelmanager.com )
# inspired by
# svnvimdiff:
# Copyright 2007 by Geoff Buchan
# http://www.vim.org/scripts/script.php?script_id=1797
# which was
# Based on the script cvsvimdiff, written by
# Stefano Zacchiroli <zack@cs.unibo.it>
package MyEnginePlackPrototype;
use strict;
use warnings;
use Plack::Request;
use JSON::XS;
use MyEngineLogic;
sub send_response
@spazm
spazm / bot_backbone_jabber.pl
Created January 10, 2012 20:50
Bot::Backbone jabber example
#!/usr/bin/perl
package Example::Bot::Backbone::Jabber;
use strict;
use warnings;
use v5.10;
use Bot::Backbone;
use DateTime;
#modified from Bot::Backbone synopsis
my $domain = 'chat.example.com';
@spazm
spazm / ff-merge-check.sh
Last active January 29, 2016 05:29
Check if git branch could be successfully merged via fast-forward.
#!/bin/sh
set -e
# Check if HEAD and REF can be related by a fast-forward merge.
# Requires that either HEAD or REF be the merge-base between the two branches
usage () {
cat << EOM
$0 -v -h REF
Checks if HEAD and REF can be fast-forwared to each other.
@spazm
spazm / 0: create the mapping
Last active August 17, 2016 23:49
elasticsearch: strings in integer field
curl -XPUT "https://localhost:9200/int_vs_str_test" -d '{"mappings": { "foo" : { "properties": { "label_id": { "type": "integer"}}}}}'
{"acknowledged":true}