Skip to content

Instantly share code, notes, and snippets.

veltman /
Last active Sep 27, 2019
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"),
oneohthree /
Last active Sep 6, 2020
Quick bash slugify
echo "$STRING" | iconv -t ascii//TRANSLIT | sed -r s/[^a-zA-Z0-9]+/-/g | sed -r s/^-+\|-+$//g | tr A-Z a-z
jmather /
Last active May 6, 2018
This is in my project's bin/ which is looked for (and ran) by my custom vagrant
cp -f app/config/parameters.dist.yml app/config/parameters.yml
rm -rf app/cache/*
php app/console doctrine:database:create
php app/console doctrine:migrations:migrate --no-interaction
yes | php app/console doctrine:fixtures:load
php app/console cache:clear
php app/console assetic:dump
php app/console assets:install --symlink
jmather / deploy.rb
Created Aug 30, 2012
Remove dev only files in production via capifony
View deploy.rb
set :dev_only_files, [web_path + "/app_dev.php", web_path + "/check.php", web_path + "/config.php"]
set :production, true
after 'symfony:cache:warmup', 'pff:productify'
namespace :pff do
desc "Remove app_dev.php, check.php and config.php from production deployment"
task :productify, :except => { :production => false } do
if dev_only_files
pretty_print "--> Removing app_dev.php, config.php, and check.php from web"
weaverryan / FeatureContext.php
Created Jun 19, 2012
Behat Definition to help click generic links on different rows of a table
View FeatureContext.php
// ...
class FeatureContext extends MinkContext
* Looks for a table, then looks for a row that contains the given text.
* Once it finds the right row, it clicks a link in that row.
You can’t perform that action at this time.