Skip to content

Instantly share code, notes, and snippets.

View edtjones's full-sized avatar

Ed Jones edtjones

  • Canva
  • UK
View GitHub Profile

I had a large dataset in postgis and wanted to avoid the hassle of first exporting it to a several GB geojson file before tiling it with Tippecanoe.

ogr2ogr -f GeoJSON /dev/stdout \                                                                            
PG:"host=localhost dbname=postgres user=postgres password=thepassword" \
-sql "select * from a, roi where a.geom && roi.geom" \
| docker run -i -v ${PWD}:/data tippecanoe:latest tippecanoe \
--output=/data/yourtiles.mbtiles
module SchemaOrderFix
def dump(stream)
header(stream)
extensions(stream)
tables(stream)
views(stream)
functions(stream)
triggers(stream)
trailer(stream)
stream
<!-- <h1 class="article-header">The Making Room</h1> -->
<p>A small paragraph to show <em>emphasis</em> and <strong>important</strong> bits.</p>
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit <a href="#">amet quam egestas semper</a>. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>
<p>Curabitur at risus sed tellus tristique bibendum nec sed urna. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Praesent malesuada aliquet quam quis efficitur. Curabitur et quam sollicitudin neque varius laoreet. Aenean non condimentum libero, convallis aliquam est. Suspendisse rhoncus consectetur posuere. Sed dapibus luctus sapien eget varius. Nulla sed felis id risus iaculis mollis. Mauris pulvinar nisl vitae leo euismod, sit amet viverra massa vehicula.</p>
<h2>How to choose the right cake</h2>
FROM urbica/martin
RUN mkdir -p /app/config
COPY config/config.yaml /app/config/config.yaml
WORKDIR /app
ENTRYPOINT /app/config/docker/entrypoint.sh $DATABASE_URL $PORT
@edtjones
edtjones / edgerouter-qos
Last active December 4, 2016 20:10 — forked from beardicus/edgerouter-qos
EdgeRouter Lite QOS Settings
#
# fair-queue based settings for EdgeRouter Lite traffic shaping
#
delete traffic-policy
# download is 8.5Mbps. everything can burst to 100%
# of bandwidth, priority rules keep the garbage in check
<MapContainer>
<Sidebar>
<SearchFilters>
<DateRange />
<AdvancedFilters />
</SearchFilters>
<FilterTabs>
<SearchTab />
<OverlaysTab />
SELECT CONCAT(table_schema, '.', table_name),
CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows,
CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), 'G') DATA,
CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G') idx,
CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size,
ROUND(index_length / data_length, 2) idxfrac
FROM information_schema.TABLES
ORDER BY data_length + index_length DESC
LIMIT 10;
@edtjones
edtjones / zabbix_cleanup.sql
Created February 10, 2016 13:55
Clean up zabbix database
SET @history_interval = 7;
SET @trends_interval = 90;
DELETE FROM alerts WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60);
DELETE FROM acknowledges WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60);
DELETE FROM events WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60);
DELETE FROM history WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60);
DELETE FROM history_uint WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60);
DELETE FROM history_str WHERE (UNIX_TIMESTAMP(NOW()) - clock) > (@history_interval * 24 * 60 * 60);
<script type="text/javascript">
// set up your
SortingOfficeConfig = {
onError: function(message) {
console.log(message);
},
onSuccess: function(data) {
console.log(data);
},
onLoading: function(data) {
@edtjones
edtjones / application_controller.rb
Created February 9, 2015 12:07
ContentfulRails - add helpers to your ApplicationController
class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception
#Include the ContentfulRails Markdown helper.
helper ContentfulRails::MarkdownHelper
end