Skip to content

Instantly share code, notes, and snippets.

shshaw / JSfixForResponsiveSVGsInSafari.js
Created January 14, 2016 15:47
A vanilla JavaScript fix (of sorts) for responsive SVGs in Safari and some other WebKit browsers.
Title: Vanilla JavaScript to fix responsive SVGs in some versions of Safari.
What it does: Stops the problem I described here: Reference URL of the issue:
It will work on all SVGs referenced inside objects as long as given the class .emb:
<object class="emb" data="img/cup.svg" type="image/svg+xml"></object>
And also any inline SVGs.
shshaw /
Last active August 29, 2015 14:02 — forked from liamcurry/
HTML5 Video format conversion with FFmpeg
# Output file for HTML5 video
# Requirements: ffmpeg .6+ with libvorbis, theora and libvpx
# ( Install via brew with `brew install ffmpeg --with-libvorbis --with-libvpx --with-theora` )
# Usage: `./ infile.mp4`
# Optional parameters:
# `./ infile.mp4 -y` to force overwriting existing videos
# `./ infile.mp4 -n 640x480` to force an output size
shshaw / functions.php
Last active August 22, 2016 10:39 — forked from fardog/functions.php
Fixes a `Creating default object from empty value` on [line 61](
function north_cast_api_data($content) {
if (is_numeric($content)) $content = intval($content);
else {
$unserialized_content = @unserialize($content);
// we got serialized content
if ($unserialized_content !== false) {
// make sure that integers are represented as such, instead of str
foreach ($unserialized_content as $fn => &$c) {