Skip to content

Instantly share code, notes, and snippets.

Shaw shshaw

Block or report user

Report or block shshaw

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
shshaw / svgclass.js
Last active Jan 3, 2016
Modifies Add/Remove class for jQuery to work with SVG elements.
View svgclass.js
var addClass = $.fn.addClass;
$.fn.addClass = function(value) {
var orig = addClass.apply(this, arguments);
var elem,
i = 0,
len = this.length;
for (; i < len; i++ ) {
shshaw / JSfixForResponsiveSVGsInSafari.js
Created Jan 14, 2016 — forked from benfrain/JSfixForResponsiveSVGsInSafari.js
A vanilla JavaScript fix (of sorts) for responsive SVGs in Safari and some other WebKit browsers.
View JSfixForResponsiveSVGsInSafari.js
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 / functions.php
Last active Aug 22, 2016 — forked from fardog/functions.php
Fixes a `Creating default object from empty value` on [line 61](
View functions.php
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) {
View index.html
<ul id="scene">
<li class="layer" data-plax="0.00"></li>
<li class="layer" data-plax="0.20"></li>
<li class="layer" data-plax="0.40"></li>
<li class="layer" data-plax="0.60"></li>
<li class="layer" data-plax="0.80"></li>
<li class="layer" data-plax="1.00"></li>
shshaw / index.html
Last active Oct 25, 2016
Listener Reactive Animation Helper [WIP]
View index.html
<button>Click me</button>
shshaw / script.babel
Last active Dec 1, 2016
Smudge & Randomize Image with PIXI.js Mesh
View script.babel
let mesh;
let cloth;
let spacingX = 5;
let spacingY = 5;
let opts = {
image: '',
pointsX: 40,
shshaw / script.js
Last active Dec 3, 2016
Waving Hairs (#3December - Day 3)
View script.js
var gui, scene, camera, renderer, orbit, lights;
function initScene () {
scene = new THREE.Scene();
camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 400 );
camera.position.x = -20;
camera.position.z = 30;
You can’t perform that action at this time.