Skip to content

Instantly share code, notes, and snippets.

View css-playing-cards.html
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Card test - 10K Hearts</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<style>
@thefrontender
thefrontender / dealer.js
Created Aug 16, 2011
Javascript Dealer class for card games.
View dealer.js
var Dealer = function (decks, suits, cards) {
var pack = [], // cards yet to be dealt (stock/shoe)
played = 0, // cards already dealt,
suitsLen,
cardsLen,
i,
j,
// Fisher-Yates shuffle - http://jsfromhell.com/array/shuffle
@thefrontender
thefrontender / hearts.js
Created Apr 15, 2012
Hearts card game in JS
View hearts.js
/*
Timing and asynchronus events
http://javascript.info/tutorial/events-and-timing-depth
PubSubJS
https://github.com/mroderick/PubSubJS
http://jsperf.com/pubsubjs-vs-jquery-custom-events/6
http://maxpert.tumblr.com/post/2658433646/puny-standalone-javascript-custom-pubsub-events-library
http://higginsforpresident.net/js/static/jq.pubsub.js
@thefrontender
thefrontender / hideaddrbar.js
Created Jan 11, 2012 — forked from scottjehl/hideaddrbar.js
Normalized hide address bar for iOS & Android (JSLint compliant)
View hideaddrbar.js
/*jslint browser: true, indent: 4 */
/*
* Normalized hide address bar for iOS & Android
* (c) Scott Jehl, scottjehl.com
* MIT License
*/
(function (win) {
'use strict';
var doc = win.document,
scrollTop = 1,
@thefrontender
thefrontender / HTML5-dictate
Created Nov 9, 2011
A quick dictation demo using new Speech, Blobs, Drag n Drog APIs from HTML5. Use latest version of Chrome.
View HTML5-dictate
<!doctype html>
<html>
<head>
<title>Dictation with HTML5 - Using Speech, Blobs, Drag & Drop APIs</title>
</head>
<body>
<input id="dictate" type="text" speech x-webkit-speech />
<textarea id="post"></textarea>
<a href="#" id="dragout" draggable="true">Save Text file (drag to desktop)</a>
<script>