Skip to content

Instantly share code, notes, and snippets.

@bmander
bmander / dotmap.pde
Created December 27, 2012 04:26
Generate dotmap tiles
/* I, Brandon Martin-Anderson, release this into the public domain or whatever. */
BufferedReader reader;
double ll, bb, rr, tt;
float A = 1000.0;
GlobalMercator proj = new GlobalMercator();
@OllyHodgson
OllyHodgson / sparkline.svg
Created January 7, 2013 09:50
Stuart Langridge's Simple SVG sparklines — http://kryogenix.org/days/2012/12/30/simple-svg-sparklines — but using an object element instead of an embed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shawnbot
shawnbot / leaflet-compact.js
Created March 13, 2013 18:04
A Leaflet TileLayer class for loading "compact" URL schemes.
L.CompactTileLayer = L.TileLayer.extend({
getTileUrl: function(tilePoint) {
this._adjustTilePoint(tilePoint);
var col = String("000000" + tilePoint.x).slice(String(tilePoint.x).length),
row = String("000000" + tilePoint.y).slice(String(tilePoint.y).length),
zoom = this._getZoomForUrl();
return this._url
.replace("{z}", zoom)
.replace("{x}", col.slice(0, 3) + "/" + col.slice(3, 6))
.replace("{y}", row.slice(0, 3) + "/" + row.slice(3, 6));

So yesterday brought the sad news that Google Reader is being killed off. C’est la vie it seems, given it was a Google product. In my search for an alternative I rediscovered Fever and decided to see if I could run it up for free on Heroku. Onwards...

Personally I think the news about Reeder is quite sad, as I would quite happily have paid for it as a service. In fact I like RSS so much that I actually shelled out the $30 for Fever when it first came out years ago (I was also pretty massive Shaun Inman fanboy if I’m being honest).

I ended up setting Fever aside because screw having to manage self-hosting for PHP and MySQL, right?

If you’re new to Fever I recommend going and checking it out, but also reading the post in response to the Google Reader announcement by Fevers author, Shaun, for a good list of what Fever is and isn’t.

Enough jibba-jabba!

[email protected] ~ $ sudo virsh dumpxml newsblur
<domain type='lxc'>
<name>newsblur</name>
<uuid>cf64daa0-9fd0-088f-2bf2-436f23c43e88</uuid>
<memory unit='KiB'>1048576</memory>
<currentMemory unit='KiB'>1048576</currentMemory>
<vcpu placement='static'>2</vcpu>
<os>
<type arch='x86_64'>exe</type>
<init>/sbin/init</init>
@shawnbot
shawnbot / index.md
Last active August 23, 2023 10:18
Testing web pages with Xcode's iOS Simulator

Finding the Simulator

You can test with the iOS Simulator that comes with Xcode. Navigate to the Xcode app in the Finder, right click and select "Show Package Contents":

screen shot 2013-05-06 at 12 04 27 pm

Then navigate to Contents > Applications, and open the shortcut to "iPhone Simulator" (it may be called "iOS Simulator" depending on which version of Xcode you're running):

screen shot 2013-05-06 at 12 05 45 pm

@kehh
kehh / st_split.sql
Last active December 17, 2015 10:39
Wrapping polygons so they don't sit on the date line Requires st_split http://postgis.17.x6.nabble.com/ST-Split-in-1-5-tp4999369p4999388.html st_split for postgis 1.5 st_wrapx from: https://github.com/mci/mpatlas/blob/master/mpatlas/ST_WrapX.sql
CREATE OR REPLACE FUNCTION st_split(polygon geometry,split_line geometry) RETURNS SETOF geometry AS
$$
DECLARE
v_geometry geometry;
BEGIN
FOR v_geometry IN SELECT (ST_Dump((
ST_Polygonize(ST_Union(ST_Boundary(polygon),split_line))
@mojodna
mojodna / gist:5609010
Created May 19, 2013 21:05
Importing Natural Earth into PostGIS w/ ogr2ogr
P900913="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"
EXTENT="-180 -85.05112878 180 85.05112878"
ogr2ogr --config PG_USE_COPY YES --config OGR_ENABLE_PARTIAL_REPROJECTION TRUE --config SHAPE_ENCODING WINDOWS-1252 -t_srs "$P900913" -lco ENCODING=UTF-8 -lco SRID=900913 -clipsrc $EXTENT -segmentize 1 -skipfailures -f PGDump /vsistdout/ ne_10m_populated_places.shp | pv | psql -d natural_earth -q
@migurski
migurski / deimgify.py
Last active December 17, 2015 13:29
Store sparse bundle disk images as a series of 24 bit losslessly-encoded PNG images. Let Flickr’s 1TB of storage hold them for you.
#!/usr/bin/env python
''' Convert a series of PNG images to a sparse bundle disk image.
Image file names are passed in as command line arguments.
Example:
ls *.png | xargs deimgify.py
Output:
Goodtimes.sparsebundle/Info.bckup
var perlin = require('perlin').noise.perlin3
var fill = require('ndarray-fill')
var zeros = require('zeros')
var scale = 0.075
var threshold = 0.125
// Untested in 3D, but "theoretically" this should
// work. Using the equivalent 2d getter with the
// continuous-box2d demo works well.