Skip to content

Instantly share code, notes, and snippets.

View the80srobot's full-sized avatar
🐮

Adam Sindelar the80srobot

🐮
View GitHub Profile
@the80srobot
the80srobot / project.clj
Created July 3, 2012 20:56
Geotools in Clojure
(ns geotools.shape-viewer
(:import [org.geotools.data CachingFeatureSource FeatureSource FileDataStore FileDataStoreFinder])
(:import [org.geotools.map DefaultMapContext MapContext])
(:import [org.geotools.swing JMapFrame])
(:import [org.geotools.swing.data JFileDataStoreChooser]))
(defn show-shapefile
"Prompts the user for a shapefile and displays its content"
[]
(if-let [shapefile (JFileDataStoreChooser/showOpenFile "shp" nil)]
(defmacro define-entity-template
[n & cs]
(let [macro-name (->> n (str "def") symbol)
docstring (if (string? (first cs)) (first cs) "")
cs (if docstring (rest cs) cs)]
;; This is where it gets slightly insane...
`(defmacro ~macro-name ~docstring
[n# & cs#]
(let [docstring# (if (string? (first cs#)) (first cs#) "")
cs# (if docstring# (rest cs#) cs#)]
@the80srobot
the80srobot / rk_test.go
Created February 11, 2022 20:23
Benchmarking some string algorithms
package rk
import (
"regexp"
"strings"
"testing"
"github.com/cloudflare/ahocorasick"
)
@the80srobot
the80srobot / Markdown.pl
Created August 5, 2022 16:52
The original Markdown.pl from 2004
#!/usr/bin/perl
#
# Markdown -- A text-to-HTML conversion tool for web writers
#
# Copyright (c) 2004 John Gruber
# <http://daringfireball.net/projects/markdown/>
#