Skip to content

Instantly share code, notes, and snippets.

Kevin Boyd beryllium

Block or report user

Report or block beryllium

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
beryllium /
Created May 3, 2019 — forked from veltman/
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

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

const fs = require("fs"),
beryllium / LegacyRedirector.php
Last active Dec 10, 2018
Legacy Redirector for Sculpin 3
View LegacyRedirector.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;

Sculpin on Windows


You'll need to have:

  • PHP 7.2 installed and configured in your path (so you can run php just by typing "php").
    • You'll probably need a few extensions enabled, like curl and openssl and maybe mbstring and a few others.
  • Git installed and configured in your path (so composer can use it).
  • Composer installed and (ideally) configured with a DOSKEY alias (so it's most useful for you! :) )
beryllium / macros.html.twig
Created Mar 11, 2018
Time-Ago Twig Macro
View macros.html.twig
{# Based on this StackOverflow example: #}
{% macro time_ago(timestamp) %}
{% set lapse = date().getTimestamp() - timestamp %}
{% set units = {
'year': 31536000,
'month': 2592000,
'week': 604800,
'day': 86400,
'hour': 3600,
# Grab the certificate and parse out some info
# Usage:
# showcerts
echo | openssl s_client -showcerts -connect "${1}:443" -servername "$1" | openssl x509 -text
beryllium /
Last active Dec 7, 2016 — forked from oneohthree/
Quick bash slugify
# Updated to work on OS X (convert both "-E" flags to "-r" to run on real server OSes)
echo "$STRING" | iconv -t ascii//TRANSLIT | sed -E s/[^a-zA-Z0-9]+/-/g | sed -E s/^-+\|-+$//g | tr A-Z a-z
beryllium /
Created Mar 13, 2013
So you're trying to piece together what exploded between two remote servers. You want to be able to diff files on them, but you don't want to be doing a whole bunch of manual file transfers. Enter:
if [ -z "$1" -o -z "$2" -o -z "$3" ]
echo "Usage: [user@]host1 [user@]host2 path_to_file"
echo ""
echo "Note: If you need to specify a valid key or optional username for the host,"
echo " you are encouraged to add the host configuration to your ~/.ssh/config file."
exit 1
beryllium /
Created Feb 23, 2013
So, you've got a bunch of servers with SSL certs and you're constantly forgetting when to renew? Fret no more! Now there's one more tool you can add to the pages-long list of tools that can solve this problem.
if [ -f "$TMP_CERT_CHECK" ]
beryllium /
Created Oct 26, 2012
Automatic SVN synchronization with UUID autocopy
# is a tool for automatically synchronizing/mirroring SVN repositories.
# By default, the script assumes that you have configured a "syncuser" account on the SRC and DEST servers,
# and that you are running the script as "syncuser" on the DEST server (presumably behind a firewall).
#Remote SVN info
SVN_HOST="" #User and host, for SSH - alternatively, you can use ~/.ssh/config to specialize something
beryllium / index.html.twig
Created Sep 29, 2014
Breakpoints in Sculpin
View index.html.twig
{# Split the post into an array using explode().
Because we provide a length of 2, the remainder
of the post will be stored in the second array
element, even if there are multiple breakpoints. #}
{% set break_array =
post.blocks.content|split('<!-- break -->', 2) %}
{# Output the first element of the array in raw mode #}
You can’t perform that action at this time.