Skip to content

Instantly share code, notes, and snippets.

View tmtrademark's full-sized avatar
🔭
Looking for Work

Toby McKes tmtrademark

🔭
Looking for Work
View GitHub Profile
@tmtrademark
tmtrademark / bits.js
Last active February 2, 2020 22:12
Full screen bit drop
jarEl.src = ``;
cupBase[1] = 5;
boxBody = new p2.Body({ mass: 0, position: [cupBase[0], cupBase[1]] });
console.log(boxBody);
boxShape = new p2.Box({ width: 1920, height: 5 });
boxShape.material = this.materials.wall;
boxBody.addShape(boxShape);
this.world.addBody(boxBody);
this.world.addBody(this.createRectangleBody([0, 0], 1, 1080, 0));
@tmtrademark
tmtrademark / WidgetWithBehaviorScript.widget.php
Created August 25, 2011 23:15 — forked from westonruter/WidgetWithBehaviorScript.widget.php
Updtaed for 3.3, thanks xavisys || WidgetWithBehaviorScript: Template for a WordPress widget which enqueues an accompanying behavior script; script only output if widget is rendered.
<?php
class WidgetWithBehaviorScript extends WP_Widget {
function __construct() {
parent::__construct(__CLASS__, 'Widget with Accompanying Behavior Script', array(
'classname' => __CLASS__,
'description' => "This WordPress widget serves as a pattern for how to enqueue a script only if the widget is actually rendered."
));