Skip to content

Instantly share code, notes, and snippets.

View davidcalhoun's full-sized avatar
🐢
may be slow to respond; PRs welcomed

David Calhoun davidcalhoun

🐢
may be slow to respond; PRs welcomed
View GitHub Profile
@davidcalhoun
davidcalhoun / transitionend.html
Created November 17, 2010 01:01
Example usage of a cross-browser ontransitionend event (CSS transition)
We couldn’t find that file to show.
<!doctype html> <!-- don't forget your doctype! -->
<html>
<head>
<style>
input { display: block; } /* use this instead of <br/> tags in your HTML */
</style>
</head>
<body>
<form name="test" id="test"> <!-- add id so you can select it with DOM2 selector getElementById -->
<select name="somename">
@davidcalhoun
davidcalhoun / microdata-highlighter.js
Created June 4, 2011 01:45
Simple Microdata Highlighter Bookmarklet
// Dead simple - works on anything with attribute CSS selectors (IE7+)
// http://en.wikipedia.org/wiki/Microdata_(HTML5)
(function(){
var a = document.createElement('style');
a.innerHTML = '[itemprop] {border: 2px solid red;}';
document.body.appendChild(a);
})();
// Paste this into your address bar
@davidcalhoun
davidcalhoun / htmlentities.js
Created June 15, 2011 07:43
Shortest HTMLEntities in JavaScript ever
/* From Ben McMahan:
http://www.quora.com/What-are-the-most-interesting-HTML-JS-DOM-CSS-hacks-that-most-web-developers-dont-know-about/answer/Ben-McMahan
Example usage:
HTMLEntities('<div id="foo">bar</div>'); // '&lt;div id="foo"&gt;bar&lt;/div&gt;'
*/
function HTMLEntities(a) {
var b = document.createElement('a');
@davidcalhoun
davidcalhoun / learning_resources.txt
Created June 19, 2011 04:49 — forked from nathansmith/web-design-development-learning-resources.md
Resources for learning web design & front-end development
Resources for learning web design & front-end development:
================================================================================
**ONLINE**
Design
> http://52weeksofux.com
> http://thedesigncubicle.com
@davidcalhoun
davidcalhoun / subscribe-bookmarklet.js
Created June 23, 2011 04:57
Google reader subscribe bookmarklet (opens in new window)
(function(){var k=void 0,n=null,o;var r=this;function s(){}
function t(a){var c=typeof a;if(c=="object")if(a){if(a instanceof Array)return"array";else if(a instanceof Object)return c;var b=Object.prototype.toString.call(a);if(b=="[object Window]")return"object";if(b=="[object Array]"||typeof a.length=="number"&&typeof a.splice!="undefined"&&typeof a.propertyIsEnumerable!="undefined"&&!a.propertyIsEnumerable("splice"))return"array";if(b=="[object Function]"||typeof a.call!="undefined"&&typeof a.propertyIsEnumerable!="undefined"&&!a.propertyIsEnumerable("call"))return"function"}else return"null";else if(c=="function"&&typeof a.call=="undefined")return"object";return c}
var u="closure_uid_"+Math.floor(Math.random()*2147483648).toString(36),aa=0;function v(a,c){function b(){}
b.prototype=c.prototype;a.v=c.prototype;a.prototype=new b}
var ba=/^[a-zA-Z0-9\-_.!~*'()]*$/;function ca(a){a=String(a);return!ba.test(a)?encodeURIComponent(a):a}
function da(a,c){for(var b=0,e=String(a).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").
@davidcalhoun
davidcalhoun / assembly
Created June 23, 2011 12:37
Old assembly code from class
// found this in my Gmail drafts... old assemly code from when I was taking this class in 2008 or so?
.ORIG x3000    ;program start
IN        ;read character from keyboard
ADD R2, R0, #0    ;place the character into R2
IN       
ADD R3, R0, #0    ;define R3
IN
ADD R4, R0, #0    ;define R4
@davidcalhoun
davidcalhoun / japan-jobs.md
Created July 31, 2011 01:53
Foreigner-friendly software companies in Japan
@davidcalhoun
davidcalhoun / japanese-guide.md
Created July 31, 2011 09:06
Quick Japanese Language Guide

Quick Japanese Language Guide

Quick rules

  • Vowels sound similar to Spanish: a = ah, e = eh, i = ee, o = oh, u = ooh.
  • Doubled letters mean long vowels. For instance, ooki is the same as ōki (ohhh-ki).
  • There are multiple ways to say things. Generally, the longer the sentence, the more polite. For an example, see "Thank you" below in Basic Conversation.
  • Some endings are barely audible, so it's best to just omit them if you try to say something. These silent endings are in parenthesis. For instance, "DES(U)" sounds like "DES". It will only sound like "DESU" when someone is being very polite.
  • Don't look at the whole word when pronouncing, just pronounce syllable by syllable. For instance, "hajimemashite" ("nice to meet you") may look hard to pronounce, but you just sound it out, splitting it up: "ha-ji-me-ma-shi-te".
@davidcalhoun
davidcalhoun / html5-mobile-web-book.md
Created August 28, 2011 20:18
HTML5 and the Mobile Web

Book outline

Overview

  • what this book is not: focus on supporting older phones, WAP and older standards
  • Focus on the future: the shift towards HTML5. making the case, showing the data, etc

Thinking differently

  • big differences on mobile: screen orientation, screen sizes, geolocation, accelerometer, usage, battery, hover states are awkward, etc.

Mobile First? More common: Mobile Last