Skip to content

Instantly share code, notes, and snippets.

$ git checkout master
$ git merge feature_branch
$ git checkout synth
$ git merge master
$ git checkout master
$ git push origin master synth
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.Serializable;
import java.net.URL;
import java.util.HashMap;
import javax.imageio.ImageIO;
trait MySelf[A <: MySelf[_]] {
def me: A
}
class Me extends MySelf[Me] {
def me: Me = this
}
class I extends MySelf[I] {
def me: I = this
class Foo {
var bar: String = ""
}
val instance = new Foo
locally {
import instance._
bar = "Special value"
}
public class Sample {
static class A {
private String foo;
private Integer bar
public A(String foo, Integer bar) {
this.foo = foo;
this.bar = bar;
}
}
def rle[A](as: Seq[A]): Seq[(Int, A)] = as match {
case Seq() => Seq()
case Seq(a, as @ _*) => (1 + as.takeWhile(a ==).length, a) +: rle(as.dropWhile(a ==))
}
rle("AAABBCCCDDDDE") map { case (i, c) => i.toString + c } mkString
* {
stroke: black, symbol(circle);
stroke-width: 15px;
stroke-linejoin: round;
stroke-linecap: round;
stroke-dasharray: 1 0, 5 35;
stroke-dashoffset: 0;
z-index: 0, 10;
}
* {
label: [strtouppercase(TITLE)];
}
[type='store'] {
mark: url("http://example.com/storefront.jpeg");
}
[type='restaurant'] {
mark: url("http://example.com/restaurant.jpeg");
}
from django.contrib.gis.geos import GEOSGeometry
import json
import sys
bluemarble = r"""{
"fields": {
"fixed": true,
"format": null,
"group": "background",
"layer_params": "{\"args\": [\"bluemarble\", \"http://maps.opengeo.org/geowebcache/service/wms\", {\"layers\": [\"bluemarble\"], \"tiled\": true, \"tilesOrigin\": [-20037508.34, -20037508.34], \"format\": \"image/png\"}, {\"buffer\": 0}], \"type\": \"OpenLayers.Layer.WMS\"}",