Skip to content

Instantly share code, notes, and snippets.

@ndimiduk
ndimiduk / multirs.py
Created January 21, 2014 19:25
Automation for managing multiple RegionServer processes running on a single host
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#!/usr/bin/env python
import io
import mapnik
from shapely.geometry import box, MultiPoint
class SimpleDatasource(mapnik.PythonDatasource):
def __init__(self):
@ndimiduk
ndimiduk / core.clj
Last active December 11, 2015 00:29
An example of consuming HBase tables from Cascalog using my patched HBaseScheme in ndimiduk/maple.
(ns cascalog-repl.core
"An example of consuming an HBase tap from Cascalog. First, create and
populate the table:
$ hbase shell
> create 't1', 'f1'
> put 't1', 'TheRealMT', 'f1:user', 'Mark Twain'
> put 't1', 'TheRealMT', 'f1:email', '[email protected]'
> put 't1', 'TheRealMT', 'f1:pass', 'abc123'
> put 't1', 'GrandpaD', 'f1:user', 'Fyodor Dostoyevsky'
#!/usr/bin/env python
###############################################################################
# $Id$
#
# Project: GDAL2Tiles, Google Summer of Code 2007 & 2008
# Global Map Tiles Classes
# Purpose: Convert a raster into TMS tiles, create KML SuperOverlay EPSG:4326,
# generate a simple HTML viewers based on Google Maps and OpenLayers
# Author: Klokan Petr Pridal, klokan at klokan dot cz
# Web: http://www.klokan.cz/projects/gdal2tiles/
@ndimiduk
ndimiduk / nuke-brew.sh
Created March 24, 2012 02:03
clean /usr/local of brew and cruft. will destroy non-brew installed files.
brew ls | xargs brew rm
brew cleanup
brew ls --unbrewed | xargs -I {} rm -rf /usr/local/{}
$ git --no-pager diff 1.5.2 1.7.0 src/leiningen/util/file.clj
diff --git a/src/leiningen/util/file.clj b/src/leiningen/util/file.clj
index 638cfe7..0a1f90d 100644
--- a/src/leiningen/util/file.clj
+++ b/src/leiningen/util/file.clj
@@ -11,6 +11,7 @@
"Delete file f. If it's a directory, recursively delete all its contents.
Raise an exception if any deletion fails unless silently is true."
[f & [silently]]
+ (System/gc) ; This sometimes helps release files for deletion on windows.
$ git --no-pager diff 1.5.2 1.7.0 src/leiningen/clean.clj
diff --git a/src/leiningen/clean.clj b/src/leiningen/clean.clj
index 85bffcc..73a86f6 100644
--- a/src/leiningen/clean.clj
+++ b/src/leiningen/clean.clj
@@ -20,6 +20,5 @@
Set :extra-files-to-clean in project.clj to delete other files. Dependency
jars are not deleted; run deps task to delete all jars and get fresh ones."
[project]
- (println "Cleaning up.")
Local: (detached) ~/repos/leiningen/
Head: 5675ec3 Release 1.7.0.
Changes:
Modified src/leiningen/clean.clj
diff --git a/src/leiningen/clean.clj b/src/leiningen/clean.clj
index 73a86f6..85bffcc 100644
--- a/src/leiningen/clean.clj
+++ b/src/leiningen/clean.clj
@@ -20,5 +20,6 @@
Local: (detached) ~/repos/leiningen/
Head: 5675ec3 Release 1.7.0.
Changes:
Modified src/leiningen/clean.clj
diff --git a/src/leiningen/clean.clj b/src/leiningen/clean.clj
index 73a86f6..98ca015 100644
--- a/src/leiningen/clean.clj
+++ b/src/leiningen/clean.clj
@@ -9,10 +9,7 @@
@ndimiduk
ndimiduk / gist:821802
Created February 11, 2011 02:17
likely multiple things broken here...
;; format.clj
(defn- format-related-filter ...)
(defn- format-related-parsing ...)
(defn read-raw
"utility function for reading common file type. source is a path"
[source]
(let [source (hfs-textline source)]
(<- [?field1 ?field2]