Skip to content

Instantly share code, notes, and snippets.

View lundvall's full-sized avatar

Martin Lundvall lundvall

View GitHub Profile

Keybase proof

I hereby claim:

  • I am lundvall on github.
  • I am lundvall (https://keybase.io/lundvall) on keybase.
  • I have a public key whose fingerprint is 4003 19A0 3BE8 20AD A608 C39E B996 B037 2795 4781

To claim this, I am signing this object:

@lundvall
lundvall / continuouslyBuildBaseDir.groovy
Last active July 26, 2016 13:36
Continuously Build BaseDir
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "io.ratpack:ratpack-gradle:1.3.3"
}
}
apply plugin: "io.ratpack.ratpack-groovy"
@lundvall
lundvall / rogue-element.css
Created November 25, 2015 09:43
Add this to the bottom of your css
* {
background: #000 !important;
color: #0f0 !important;
outline: solid #f00 1px !important;
}
@lundvall
lundvall / ScheduledService.java
Created September 14, 2015 11:29
Ratpack scheduled service
import ratpack.exec.ExecController;
import ratpack.server.Service;
import ratpack.server.StartEvent;
import ratpack.server.StopEvent;
import java.util.concurrent.TimeUnit;
public class ScheduledService implements Service, Runnable {
public String getName() {
return getClass().getSimpleName();
@lundvall
lundvall / Interval.groovy
Created July 17, 2015 10:33
Merge overlapping intervals
package io.github.lundvall
import groovy.transform.CompileStatic
import groovy.transform.Immutable
@Immutable
@CompileStatic
class Interval {
long low
long high
@lundvall
lundvall / testFrameworkInATweet.groovy
Last active August 29, 2015 14:24
Test framework in a tweet
def it = { m, f -> println "${(f() ? '✔' : '✘')} It $m" }
it("should sum two numbers") { 1 + 1 == 2 }
it("should display an X for a failing test") { 1 + 1 == 3 }
@lundvall
lundvall / DateURLRegExp.groovy
Created June 2, 2015 19:03
Date URL RegExp
get("report/:start:\\d{4}-\\d{2}-\\d{2}/:end:\\d{4}-\\d{2}-\\d{2}") { ... }
@lundvall
lundvall / bash_prompt
Created May 22, 2015 13:57
bash_prompt
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then
export TERM='gnome-256color';
elif infocmp xterm-256color >/dev/null 2>&1; then
export TERM='xterm-256color';
fi;
prompt_git() {
local s='';
local branchName='';
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'io.ratpack:ratpack-gradle:1.1.1',
'com.github.jengelman.gradle.plugins:shadow:1.2.2'
}
}
public class EmailMessage
{
private string Sender;
private string To;
private string Subject;
private string Content;
private string MimeType; // optional
private EmailMessage() { }