Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tschaub
tschaub / sbt
Created August 27, 2013 03:14
OSX sbt launcher. Download sbt-launch.jar, put this script next to it, and create a symbolic link to this script on your path.
CWD=`pwd`
SELF=$0
cd `dirname $SELF`
SELF=`basename $SELF`
# Iterate down a (possible) chain of symlinks
while [ -L "$SELF" ]
do
@tschaub
tschaub / serve.js
Last active December 22, 2015 21:29
Using closure-util package instead of Plovr for ol3
var path = require('path');
var url = require('url');
var log = require('npmlog');
var closure = require('closure-util');
log.info('serve', 'Parsing dependencies ...');
var root = '.'; // assumes you're running this from ol3 repo
@tschaub
tschaub / master.js
Created November 26, 2013 15:50
Highlight a feature on the map based on user interaction with a feature table. The two examples below provide a "highlight" function. In both cases, the application would be responsible for getting a feature based on user interaction with a feature table. The highlight function just shows the code necessary to highlight the feature on the map.
/**
* Layer with a style that provides symbolizers for
* the "selected" render intent defined elsewhere.
*/
function highlight(feature) {
feature.setRenderIntent('selected');
}
@tschaub
tschaub / AngularStyle.md
Last active December 20, 2016 15:28
Opinionated whitespace guide for AngularJS modules

AngularJS Whitespace Guide

The purpose of this style guide is to suggest formatting conventions for AngularJS modules that result in readible, maintainable, and lint free code (see the linter configurations for JSHint and gjslint.py.

All-in-one example

Typically, an AngularJS application would be structured with many modules in separate files. The example below shows a monolithic module to illustrate the formatting conventions for various module methods.

angular.module('module.name', [
@tschaub
tschaub / 1-geoserver-scripting.md
Last active August 29, 2015 13:56
Build GeoServer with scripting support

Build GeoTools:

cd ~/projects/geotools
mvn clean install -DskipTests -T 4C

(Skip the -T 4C for Maven 2.)

Build GeoServer and prep Eclipse project:

cd ~/projects/geoserver/src

#!/bin/bash
set -o errexit
# This script gives you git bash completion and a minimal
# prompt displaying the branch name.
PROFILE=""
if [ -f "$HOME/.bashrc" ]; then
PROFILE="$HOME/.bashrc"
elif [ -f "$HOME/.bash_profile" ]; then
@tschaub
tschaub / git-tidy-alias.sh
Last active August 24, 2021 19:02
Prune all remotes and delete all branches that are already merged into the current branch
git config --global alias.tidy '!for r in `git remote`; do git remote prune $r; done && git branch --merged | grep -v "\*" | xargs -n 1 git branch -d'
@tschaub
tschaub / _.md
Last active November 29, 2023 02:06
TopoJSON Time Zones

TopoJSON Time Zones

The result is this 181 KB timezones.json (36 KB with gzip)

@tschaub
tschaub / .gitignore
Last active April 25, 2019 22:34
OpenLayers + Rollup
/node_modules/
bundle.js