Skip to content

Instantly share code, notes, and snippets.

View hastebrot's full-sized avatar

Benjamin Gudehus hastebrot

  • Freiheit.com
  • Hamburg, Germany
  • 12:28 (UTC +01:00)
View GitHub Profile
@hastebrot
hastebrot / mongoose.dbref.example.js
Created August 25, 2011 15:20
Example of DBRef support in Mongoose 2.0
var mongoose = require("mongoose");
var Schema = mongoose.Schema;
mongoose.connect("127.0.0.1", "mongoose_dbref", 27017);
var PersonSchema = new Schema({
name : String
, age : Number
, stories : [{ type: Schema.ObjectId, ref: 'Story' }]
});
var StorySchema = new Schema({
@hastebrot
hastebrot / division.c
Created August 26, 2011 18:33
division performance
#include <stdio.h>
#include <time.h>
int main(void) {
clock_t start, end;
double duration;
int counter = 0;
float x;
start = clock();
@hastebrot
hastebrot / list_plugins.rb
Created November 12, 2011 23:22
OpenJUMP 1.4.2 Plugin List
import "com.vividsolutions.jump.workbench.ui.AttributeTab"
import "com.vividsolutions.jump.workbench.ui.LayerViewPanel"
workbench_frame = $wc.workbench.frame
menu_bar = workbench_frame.get_jmenu_bar()
tool_bar = workbench_frame.get_tool_bar() # as JToolBar
layer_name_popup_menu = workbench_frame.get_layer_name_popup_menu()
category_popup_menu = workbench_frame.get_category_popup_menu()
@hastebrot
hastebrot / ExampleGroovyParser.groovy
Created December 8, 2011 15:33
parboiled: Illegal rule definition: Unwrapped action expression!
import org.parboiled.BaseParser
import org.parboiled.Parboiled
import org.parboiled.Rule
import org.parboiled.annotations.BuildParseTree
import org.parboiled.parserunners.ReportingParseRunner
import org.parboiled.support.ParseTreeUtils
@BuildParseTree
class ExampleGroovyParser extends BaseParser {
// start = "a"+ "b"+
/*
* The Unified Mapping Platform (JUMP) is an extensible, interactive GUI
* for visualizing and manipulating spatial features with geometry and attributes.
*
* Copyright (C) 2003 Vivid Solutions
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
--- C:/Users/Benjamin/AppData/Local/Temp/DeleteDuplicateGeometriesPlugIn.jav-rev2619.svn001.tmp.java Sun Jan 15 23:17:54 2012
+++ C:/Users/Benjamin/AppData/Local/Temp/DeleteDuplicateGeometriesPlugIn.jav-rev2620.svn001.tmp.java Sun Jan 15 23:18:01 2012
@@ -27,13 +27,12 @@
*/
/*****************************************************
* created: 30.01.2006
- * last modified:
+ * last modified: 15.01.2012
*
*
package sscce;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.Id;
import com.avaje.ebean.EbeanServer;
import com.avaje.ebean.EbeanServerFactory;
---
# com.vividsolutions.jump.workbench.ui.plugin.CombineSelectedFeaturesPlugIn
File:
- name : New Project
plugin : com.vividsolutions.jump.workbench.ui.plugin.NewTaskPlugIn
icon : silk_icons/icons/folder_add.png
- name : Open Project...
plugin : com.vividsolutions.jump.workbench.ui.plugin.OpenProjectPlugIn
icon : silk_icons/icons/folder.png
- name : Open Dataset...
@hastebrot
hastebrot / index.html
Created January 28, 2013 14:35 — forked from mbostock/.block
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Mobile Patent Suits</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?1.29.1"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.geom.js?1.29.1"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js?1.29.1"></script>
<style type="text/css">
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.