Skip to content

Instantly share code, notes, and snippets.

@thecountofzero
thecountofzero / leak.html
Last active December 29, 2015 05:39
Memory Leak Test
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Memory Leak Test</title>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Swallower</title>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>CanJS Bindings Test</title>
</head>
<body>
<div id='live'>
<button class="atbat">Add At Bat</button>
steal('can',function(){
Stat = can.Model({
id: "name",
findAll: function(){
var def = $.Deferred();
setTimeout(function(){
def.resolve([
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Memory Leak Test</title>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Memory Leak Test</title>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
@thecountofzero
thecountofzero / polling-findall-leak.html
Last active December 16, 2015 03:49
Testing for a memory leak when polling, where the polling action is issuing a findAll request
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Memory Leak Test</title>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
@thecountofzero
thecountofzero / gist:4945394
Last active December 13, 2015 17:09
IsReady Support For Controls
steal('can/control',
'can/construct/super', function() {
window.MyApp = window.MyApp || {};
window.MyApp.Controls = window.MyApp.Controls || {};
window.MyApp.Controls.BaseControl = can.Control({
defaults: {}
}, {
@thecountofzero
thecountofzero / canjs-model.sublime-snippet
Created July 12, 2012 00:17
Sublime Text 2 CanJS Model Snipper
<snippet>
<content><![CDATA[
steal('can/model', function(\$) {
can.Model("${1:namespace}", {
findAll : 'GET /${2:resource}',
findOne : 'GET /${2:resource}/{id}',
create : 'POST /${2:resource}',
update : 'PUT /${2:resource}/{id}',
destroy : 'DELETE /${2:resource}/{id}'