Skip to content

Instantly share code, notes, and snippets.

View kumikoda's full-sized avatar
🧎‍♂️
Summoning AI God

Anson Chu kumikoda

🧎‍♂️
Summoning AI God
View GitHub Profile
@kumikoda
kumikoda / backbone_memleak_free.coffee
Last active December 22, 2015 16:49
a memory leak FREE backbone template
class Item extends Backbone.Model
class ItemList extends Backbone.Collection
class ItemView extends Backbone.View
template : _.template '<%= text %>'
initialize : ->

A love story written by me

Characters

Nick : an elevator engineer Laura : a beautiful girl Betsy : an intelligent elevator robot Shane : the simpleton

@kumikoda
kumikoda / timeout.html
Last active February 8, 2022 15:59
A simple example demonstrating how setTimeout(fn, 0) can be useful. This gist illustrates the answer given by DVK's on stackoverflow. http://stackoverflow.com/a/4575011/783478
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<button id='do'> Do long calc!</button>
<div id='status'></div>
<div id='result'></div>
<script>
$('#do').on('click', function(){