Skip to content

Instantly share code, notes, and snippets.

@beryllium
beryllium / LegacyRedirector.php
Last active December 10, 2018 16:47
Legacy Redirector for Sculpin 3
<?php
namespace Beryllium\Whateverthing;
use Sculpin\Core\Event\SourceSetEvent;
use Sculpin\Core\Output\FilesystemWriter;
use Sculpin\Core\Output\OutputInterface;
use Sculpin\Core\Permalink\Permalink;
use Sculpin\Core\Permalink\PermalinkInterface;
use Sculpin\Core\Sculpin;
@beryllium
beryllium / tiles.md
Created May 3, 2019 16:55 — forked from veltman/tiles.md
Making a big image zoomable

Making a big image zoomable

When you have a giant image and you want to make it easy to pan and zoom without downloading the whole 50MB image into someone's browser, a nice workaround is to cut that image into tiles at different zoom levels and view it as it were a map. An example where I've used this technique is The "Snowpiercer" Scenario.

One way to cut your big image into the requisite tiles is with gdal2tiles.py.

Alternatively, this Node script will do the cutting after you install node-canvas and mkdirp:

const fs = require("fs"),
@beryllium
beryllium / Doc.md
Created November 11, 2022 21:35
Sculpin article excerpts

Sculpin Article Excerpts

The Breakaway

This method uses a special string, <!-- break -->, to denote a breakpoint in index.html:

{# Split the post into an array using explode().
   Because we provide a length of 2, the "rest"
 of the post will be stored in the second array