Skip to content

Instantly share code, notes, and snippets.

@springmeyer
springmeyer / config.py
Last active August 29, 2015 14:02
Mapnik 2.3.x config for packaging
CUSTOM_CXXFLAGS = '-fvisibility-inlines-hidden -DU_CHARSET_IS_UTF8=1'
CUSTOM_LDFLAGS = ''
RUNTIME_LINK = 'static'
INPUT_PLUGINS = 'csv,gdal,geojson,occi,ogr,osm,postgis,python,raster,rasterlite,shape,sqlite'
WARNING_CXXFLAGS = '-Wno-deprecated-register -Wno-redeclared-class-member'
PATH = '../mapnik-packaging/osx/out/build-cpp03-libstdcpp-gcc-x86_64-macosx/bin/'
BOOST_INCLUDES = '../mapnik-packaging/osx/out/build-cpp03-libstdcpp-gcc-x86_64-macosx/include'
BOOST_LIBS = '../mapnik-packaging/osx/out/build-cpp03-libstdcpp-gcc-x86_64-macosx/lib'
BOOST_PYTHON_LIB = 'boost_python-2.7'
FREETYPE_CONFIG = '../mapnik-packaging/osx/out/build-cpp03-libstdcpp-gcc-x86_64-macosx/bin/freetype-config'
@springmeyer
springmeyer / win-setup.bat
Created June 26, 2014 01:10
windows dev env
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin
cinst wget
cinst msysgit
cinst curl
cinst 7zip
@rem for bsdtar, perhaps a mistake as its massive
cinst GnuWin
@ rem bsdtar will be available if you close the term and re-open a new one
@powershell Set-ExecutionPolicy -Scope "CurrentUser" -ExecutionPolicy "Unrestricted"
@springmeyer
springmeyer / llvm-setup.sh
Created July 3, 2014 18:47
clang/llvm/iwyu setup
# http://clang-developers.42468.n3.nabble.com/How-to-determine-clang-s-system-include-dirs-to-set-in-ASTVisitor-td4029080.html
: '
https://gist.github.com/springmeyer/4480481
https://gist.github.com/springmeyer/4279264
'
git clone http://llvm.org/git/llvm.git
cd llvm/tools
git clone http://llvm.org/git/clang.git
@springmeyer
springmeyer / gist:d84023e69e2e2af921e2
Created July 29, 2014 19:58
diff -d -r -u node-v0.11.13 node-v0.11.13_atom
Only in node-v0.11.13: .gitattributes
Only in node-v0.11.13: .gitignore
Only in node-v0.11.13: .mailmap
Only in node-v0.11.13: AUTHORS
Only in node-v0.11.13: BSDmakefile
Only in node-v0.11.13: CONTRIBUTING.md
Only in node-v0.11.13: ChangeLog
Only in node-v0.11.13: LICENSE
Only in node-v0.11.13: Makefile
Only in node-v0.11.13: README.md
@springmeyer
springmeyer / icu.diff
Created August 29, 2014 22:16
ICU 53.1 patches for building with Visual Studio 2014 CTP #3
diff --git a/source/common/unicode/umachine.h b/source/common/unicode/umachine.h
index d1102f4..17e696e 100644
--- a/source/common/unicode/umachine.h
+++ b/source/common/unicode/umachine.h
@@ -120,6 +120,21 @@
/* limits for int32_t etc., like in POSIX inttypes.h */
/*==========================================================================*/
+#if defined(_MSC_VER) && _MSC_VER >= 1900
+#undef INT8_MAX
@springmeyer
springmeyer / feat.cpp
Created September 3, 2014 16:50
win debug variant
#include <iostream>
#include <mapnik/util/variant.hpp>
#include <mapnik/value.hpp>
#include <mapnik/unicode.hpp>
#include <ostream>
//#include <mapnik/feature.hpp>
//#include <mapnik/feature_factory.hpp>
int main() {
mapnik::value val = 0.0;
diff --git a/include/mapnik/util/variant.hpp b/include/mapnik/util/variant.hpp
index d6f8002..e74170b 100644
--- a/include/mapnik/util/variant.hpp
+++ b/include/mapnik/util/variant.hpp
@@ -553,13 +553,12 @@ public:
template <typename T, class = typename std::enable_if<
detail::is_valid_type<T, Types...>::value>::type>
VARIANT_INLINE variant(T && val) noexcept
- : type_index(detail::value_traits<T, Types...>::index)
+ : type_index(detail::value_traits<std::remove_reference<T>::type, Types..
@springmeyer
springmeyer / mapnik-overzoom-debug.diff
Created September 3, 2014 20:24
mapnik-overzoom-debug.diff
diff --git a/include/mapnik/renderer_common/process_raster_symbolizer.hpp b/include/mapnik/renderer_common/process_raster_symbolizer.hpp
index 08d9000..503be8b 100644
--- a/include/mapnik/renderer_common/process_raster_symbolizer.hpp
+++ b/include/mapnik/renderer_common/process_raster_symbolizer.hpp
@@ -24,6 +24,7 @@
#define MAPNIK_RENDERER_COMMON_PROCESS_RASTER_SYMBOLIZER_HPP
// mapnik
+#include <mapnik/debug.hpp>
#include <mapnik/warp.hpp>
This file has been truncated, but you can view the full file.
@springmeyer
springmeyer / memusg
Created September 30, 2014 17:23
track peak memory usage of program
#!/usr/bin/env bash
# memusg -- Measure memory usage of processes
# Usage: memusg COMMAND [ARGS]...
#
# Author: Jaeho Shin <netj@sparcs.org>
# Created: 2010-08-16
set -um
# check input
[ $# -gt 0 ] || { sed -n '2,/^#$/ s/^# //p' <"$0"; exit 1; }