Skip to content

Instantly share code, notes, and snippets.

View phated's full-sized avatar
💰
Sponsor my open source work! https://github.com/sponsors/phated

Blaine Bublitz phated

💰
Sponsor my open source work! https://github.com/sponsors/phated
View GitHub Profile
@phated
phated / json-template.html
Created January 3, 2012 22:25
Extremely basic concept for a templating engine
<html>
<head>
</head>
<body>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
<script>
$(document).ready(function(){
var template = {
div : 'test'
@phated
phated / 10k-json-to-html.html
Created January 5, 2012 00:11
Profiling of converting 10k json elements to html elements
<html>
<head>
<!--<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>-->
<script src="https://raw.github.com/madrobby/zepto/master/src/zepto.js"></script>
<!--<script src="http://download.dojotoolkit.org/release-1.7.1/dojo.js"></script>-->
<script>
$(document).ready(function(){
//dojo.ready(function(){
var generated = '{';
@phated
phated / template.json
Created January 6, 2012 21:13
JSON Template Object
var template;
template = [
{
div: {
div: {
div: {
a: "Project Name",
ul: [
{
li: {
@phated
phated / jist.html
Created January 6, 2012 21:19
1-6-12 JSON Templating
<html>
<head>
<script>
document.addEventListener("DOMContentLoaded", function() {
var template;
template = [
{
div: {
div: {
@phated
phated / clazz.coffee
Created February 7, 2012 20:09
Trying to use coffeescript Class
class Stackr
constructor: ->
@stack = []
@navHeaders = $ '.nav-header'
@userStack = $ '#stack'
highlightActive: (event) =>
@navHeaders.removeClass 'active'
$(event.currentTarget).addClass 'active'
@phated
phated / rAFshim.coffee
Created February 14, 2012 20:29
window.requestAnimationFrame shim
###
http://paulirish.com/2011/requestanimationframe-for-smart-animating/
http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
requestAnimationFrame polyfill by Erik Möller
fixes from Paul Irish and Tino Zijdel
Coffeescript and AMD by Blaine Bublitz
###
@phated
phated / mouseLoc.coffee
Created February 16, 2012 23:17
idea for mouse location
getMouseLoc: (event) ->
coordsM = domGeom.position @canvas
return { x: Math.round(event.clientX - coordsM.x), y: Math.round(event.clientY - coordsM.y) } unless box?
return { x: (event.clientX - coordsM.x) / @box.scale, y: (event.clientY - coordsM.y) / @box.scale }
@phated
phated / gist:2831051
Created May 29, 2012 21:58
JSON Serialized dojox/gfx object
[
{
"shape": {
"type": "image",
"x": -78.81720430107526,
"y": 30,
"width": 777.6344086021505,
"height": 560,
"src": "https://super_cool_url.com/images/4fc523c4fa0b3510de00000f/lightning-original.jpg?1338319812"
},
@phated
phated / gist:3779516
Created September 25, 2012 01:47
Alisa's Bitch Logic
var complain = function(){
alert('FUCK THIS SHIT!');
};
var noFucksWereGiven = function(){
return;
};
var doSomethingAboutIt = function(fucks){
bitchLogic(fucks--);
@phated
phated / gist:4570696
Last active December 11, 2015 08:08
Deferred Shieldbot
var five = require("johnny-five");
var Shieldbot = require('./src/shieldbot');
var board = new five.Board();
board.on("ready", function() {
var shieldbot = new Shieldbot();