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
@veltman
veltman / tiles.md
Last active Sep 27, 2019
Making a big image zoomable
View tiles.md

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"),
@oneohthree
oneohthree / quick-slugify.sh
Last active Oct 5, 2019
Quick bash slugify
View quick-slugify.sh
echo "$STRING" | iconv -t ascii//TRANSLIT | sed -r s/[^a-zA-Z0-9]+/-/g | sed -r s/^-+\|-+$//g | tr A-Z a-z
@jmather
jmather / .vagrant.init.sh
Last active May 6, 2018
This is in my project's bin/.vagrant.init.sh which is looked for (and ran) by my custom vagrant provision.sh
View .vagrant.init.sh
#!/bin/sh
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
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
weaverryan / FeatureContext.php
Created Jun 19, 2012
Behat Definition to help click generic links on different rows of a table
View FeatureContext.php
<?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.