Skip to content

Instantly share code, notes, and snippets.

David Kolb dkolb

Block or report user

Report or block dkolb

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View airrecord_table_utilities.rb
module AirrecordTableUtilities
def self.included base
base.extend ClassMethods
base.include InstanceMethods
end
module ClassMethods
def map_field(method_name, field_name)
define_method method_name do
self[field_name]
View keybase.md

Keybase proof

I hereby claim:

  • I am dkolb on github.
  • I am dkub (https://keybase.io/dkub) on keybase.
  • I have a public key ASCbWZkyUNuYmtePFCoI1BGkk3aKVqcA67FBKzmrnL5NpAo

To claim this, I am signing this object:

View StoneBreakingListener.java
package com.krinchan.minecraft.spongediamondfinder.listeners;
import org.slf4j.Logger;
import org.spongepowered.api.entity.living.player.Player;
import org.spongepowered.api.event.Listener;
import org.spongepowered.api.event.block.ChangeBlockEvent;
/**
* Created by david on 2/6/16.
*/
@dkolb
dkolb / a.js
Last active Dec 24, 2015
Node.js Module Globals Example
View a.js
var b = require(__dirname + "/b"),
c = require(__dirname + "/c");
b.doIt();
console.log(c.get()); //Outputs 'b.doIt is updating stuff!'
@dkolb
dkolb / parseXsdDateTime.groovy
Created Sep 14, 2013
Making xsd:dateTime values for SoapUI tasks (e.g. getting today and 30 days ago).
View parseXsdDateTime.groovy
import java.util.Calendar
import javax.xml.bind.DatatypeConverter
now = Calendar.getInstance()
endDate = DatatypeConverter.printDateTime(now)
now.add(Calendar.DAY_OF_MONTH, -30)
startDate = DatatypeConverter.printDateTime(now)
@dkolb
dkolb / MapAbuse.pl
Created Sep 14, 2013
A blatant abuse of map and Perl Hash/Array quirks to parse some output.
View MapAbuse.pl
#!/usr/bin/perl
use Data::Dumper;
$reports = [
'16:02:10,663 INFO [log] STNDRDTESTRESULT operation=getEntityA,endpoint=http://server01.example.com/SomeService,status=VALID',
'16:02:18,485 INFO [log] STNDRDTESTRESULT operation=getEntityB,endpoint=http://server01.example.com/SomeOtherService,status=VALID',
'16:02:18,490 INFO [log] STNDRDTESTRESULT operation=getEntityB,endpoint=http://server02.example.com/SomeOtherService,status=VALID',
'16:02:20,657 INFO [log] STNDRDTESTRESULT operation=getEntityB,endpoint=http://server03.example.com/SomeOtherService,status=VALID',
'16:02:20,657 INFO [log] STNDRDTESTRESULT operation=getEntityB,endpoint=http://server04.example.com/SomeOtherService,status=VALID',
'16:02:22,276 INFO [log] STNDRDTESTRESULT operation=getEntityB,endpoint=http://server05.example.com/SomeOtherService,status=VALID',
@dkolb
dkolb / gist:6345750
Last active Dec 21, 2015
Function Templates
View gist:6345750
my $cliSettings = {};
my $cliSettings->{'testName'} = "Standard";
my $verbose = 1;
{
# A function to return functions!
# you call &$getPathTemplate with a function that accepts a single, scalar (not reference)
# argument and returns true or false (1 or 0 in Perl) the second argument is
# a flag for the second argument that denotes if the destination this GetOptions
You can’t perform that action at this time.