Skip to content

Instantly share code, notes, and snippets.

View nwertzberger's full-sized avatar

Nick Wertzberger nwertzberger

View GitHub Profile
@nwertzberger
nwertzberger / dayBill.pl
Created September 12, 2012 23:35
A daily interruption log reader.
#!/usr/bin/perl
=head1 USAGE
Lines that start with @ are personal times
Otherwise it's a mandatory time.
All interruptions cost 15 minutes of transition time.
Day: Sep. 12, 2012
WORK 8:20 - 17:30
@ 8:25 - 8:55 # Code Katas
@nwertzberger
nwertzberger / mycat.pl
Created October 25, 2012 02:49
Free-form coding.
#!/usr/bin/perl
# Like you thought i'd use something else
my %cats = (
purring => {
# Specify default probability as well as probabilities given the previous
# action.
default => .1 / 24
},
eating => {
@nwertzberger
nwertzberger / gist:6662046
Created September 22, 2013 17:29
add-vmail
#!/bin/bash
EMAIL=$1
USER=${EMAIL%%@*}
DOMAIN=${EMAIL##*@}
echo $USER
echo $DOMAIN
PASSWD=`doveadm pw`
S=50;
D=2;
module heart() {
cube([1*S,1*S,D]);
translate([1*S,.5*S,0]) {
rotate(a=[0,0,10]) scale([1.25,1,1]) cylinder(r=.5*S, h=D);
}
translate([.5*S,1*S,0]) {
@nwertzberger
nwertzberger / arc.scad
Created November 18, 2014 02:18
Calculates an arc by cutting apart cylinders. Only good in the z plane.
/* Yet Another Arc Library
* Calculates an arc by cutting apart cylinders. Only good in the z plane.
* What's kind of nice is that you can jsut specify what the coordinates of
* your arc should start and end at.
* Only good up to 180 degrees.
*/
function scalar(vec) = sqrt(pow(vec.x, 2) + pow(vec.y, 2) + pow(vec.z, 2));
module arc(startCoordinates, endCoordinates, degrees, height, width) {
@nwertzberger
nwertzberger / gist:f564cefe0d9eb88494d6
Last active August 29, 2015 14:19
appassembler plugin configuration
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>appassembler-maven-plugin</artifactId>
<version>1.9</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>generate-daemons</goal>
package com.ideaheap.decisions.tmt.agents.tmtAgent.behaviours;
import com.github.oxo42.stateless4j.StateMachine;
import com.github.oxo42.stateless4j.StateMachineConfig;
import com.ideaheap.decisions.tmt.dto.DesireDefinitions;
import com.ideaheap.decisions.tmt.dto.TmtModel;
import com.ideaheap.decisions.tmt.dto.TmtOutcome;
import com.ideaheap.decisions.tmt.dto.TmtSuggestion;
import com.ideaheap.jade.fluent.df.DfServiceFinderFactory;
import com.ideaheap.jade.fluent.messages.MessageBuilder;
package com.ideaheap.decisions.tmt.agents.tmtAgent.behaviours;
import com.github.oxo42.stateless4j.StateMachine;
import com.github.oxo42.stateless4j.StateMachineConfig;
import com.ideaheap.decisions.tmt.dto.TmtAgentState;
import com.ideaheap.decisions.tmt.dto.TmtSuggestion;
import com.ideaheap.jade.fluent.df.DfServiceFinderFactory;
import com.ideaheap.jade.fluent.messages.MessageReceiverException;
import com.ideaheap.jade.fluent.messages.MessageReceiverFactory;
import com.ideaheap.jade.fluent.messages.MessageSender;
package com.ideaheap.decisions.tmt.agents.tmtAgent.behaviours;
import com.ideaheap.decisions.tmt.dto.TmtAgentState;
import com.ideaheap.decisions.tmt.dto.TmtSuggestion;
import com.ideaheap.jade.fluent.df.DfServiceFinder;
import com.ideaheap.jade.fluent.df.DfServiceFinderFactory;
import com.ideaheap.jade.fluent.messages.BaseMessageReceiver;
import com.ideaheap.jade.fluent.messages.MessageReceiver;
import com.ideaheap.jade.fluent.messages.MessageReceiverFactory;
import com.ideaheap.jade.fluent.messages.MessageSender;
package objects.model;
import org.pojomatic.Pojomatic;
import org.pojomatic.annotations.AutoProperty;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
import java.util.Set;