- one
- two
- three
- x
- y
- four
I hereby claim:
To claim this, I am signing this object:
/* Adapted from Tom Cunningham's 'Data Warehousing with MySql' (www.meansandends.com/mysql-data-warehouse) */ | |
###### small-numbers table | |
DROP TABLE IF EXISTS numbers_small; | |
CREATE TABLE numbers_small (number INT); | |
INSERT INTO numbers_small VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); | |
###### main numbers table | |
DROP TABLE IF EXISTS numbers; | |
CREATE TABLE numbers (number BIGINT); |
Other people's code is awful, and your own code from months previous counts as someone else's. With this and the festive spirit in mind, I dug up a canvas snow demo I made two years ago to see how bad my code really was.
Turns out the performance landscape has changed quite a bit, but after applying a couple of workarounds, best practices, and memory management, I got the demo running smoother than it ever did.
Ugh, I can't believe I just wrote "performance landscape". Anyway...
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | |
<script type="text/javascript" charset="utf-8"> | |
$(window).load(function(){ | |
$().hatchShow(); | |
}); | |
jQuery.fn.hatchShow = function (maxSize) { | |
if (!maxSize) | |
maxSize = 10000; |
/** | |
* Light loader | |
*/ | |
* { | |
margin: 0; | |
padding: 0; | |
} | |
html { |
/** | |
* TEST | |
*/ | |
color: rgba(255, 255, 255, .5); | |
background: linear-gradient(45deg, #f06, yellow); | |
text-align: center; | |
font-family: 'Helvetica Neue'; | |
font-weight: 100; | |
font-size: 144pt; |
<script type="text/javascript"> | |
$(function() { | |
//all hover and click logic for buttons | |
$(".fg-button:not(.ui-state-disabled)").hover( | |
function() { | |
$(this).addClass("ui-state-hover"); | |
if ($(this).data('__mousedown')) { | |
if($(this).is('.ui-state-active.fg-button-toggleable, .fg-buttonset-multi .ui-state-active')) | |
$(this).removeClass("ui-state-active"); | |
else |
<select id="state" name="state"> | |
<option value="AL">Alabama</option> | |
<option value="AK">Alaska</option> | |
<option value="AZ">Arizona</option> | |
<option value="AR">Arkansas</option> | |
<option value="CA">California</option> | |
<option value="CO">Colorado</option> | |
<option value="CT">Connecticut</option> | |
<option value="DE">Delaware</option> | |
<option value="DC">District of Columbia</option> |