Skip to content

Instantly share code, notes, and snippets.

@alexbaldwin
alexbaldwin / productdesignclass
Created July 19, 2012 17:42
David Cole Notes
# Principles of product design
## David Cole, Quora
Applying principles is difficult, Dieter Rams and Paul Rand are seen as the standard, but principles are abstract and hard to apply.
History of the web has very much so evolved out of print and managing libraries worth of documents. Thus early web designers came out of this print mindset.
This changed with the introduction of AJAX, around the time of Google Maps and Gmail, interactivity and response time allowed websites to play on the level of native apps.
var computePrimes = function(limit) {
var sieve = [];
for (var i = 2; i < limit; i++) {
if (sieve[i] === false) {
continue;
}
for (var j = 2; j * i < limit; j++) {
sieve[j * i] = false;
}
}
@alexbaldwin
alexbaldwin / euler6
Created July 8, 2012 23:19
Project Euler Problem 6
var squarer = function(solvingFor) {
var squares = [];
for (i=0; i <= solvingFor; i++){
var squared = i * i;
squares.push(squared);
}
var total = 0;
for (i = 0; i < squares.length; i++ ) {
total = total + squares[i];
}
@alexbaldwin
alexbaldwin / euler2
Created July 8, 2012 06:32
Project Euler Problem 2
var fibonacci = function () {
var firstInteger = 1;
var secondInteger = 1;
var sequence = [];
while (secondInteger <= 4000000) {
if (secondInteger % 2 === 0) {
sequence.push(secondInteger);
}
@alexbaldwin
alexbaldwin / rotate3d
Created May 27, 2012 23:18
3d Acceleration of a DOM object
#user {
@include rotate3d(0, 0, 0, 0);
-webkit-animation: fade-moment-in .5s ease-out;
header, section {
margin:48px 0;
}
.avatar {
float:left;
margin-right:24px;
}
@alexbaldwin
alexbaldwin / gist:1955696
Created March 2, 2012 04:34
Fratfolder 404 Page
<!DOCTYPE html>
<html>
<head>
<title>Missing Page - 404</title>
<style type="text/css">
body { color: #fff; text-shadow: 0 1px 2px #000; font-family: "chaparral-pro", 'Helvetica Neue', arial, sans-serif; }
div.dialog {
width: 40%;
padding: 2em;
margin: 2em auto 0 2em;
@alexbaldwin
alexbaldwin / gist:1512549
Created December 23, 2011 00:48
Unicode no-fontface fallbacks
.icons.api:before { content: 'Q'; }
.icons.download:before { content: '~'; }
.icons.play:before { content: '4'; }
.icons.pause:before { content: '5'; }
.icons.stop:before { content: '6'; }
.icons.next:before { content: '7'; }
.icons.back:before { content: '8'; }
.icons.repeat:before { content: '0'; }
.icons.shuffle:before { content: ';'; }
.icons.history:before { content: '1'; }
@alexbaldwin
alexbaldwin / 404
Created November 12, 2011 03:01
Hungry error pages. Featuring full-screen background, Futura from Typekit, and Google's site search.
<!doctype html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7 ]> <html class="no-js ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]> <html class="no-js ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]> <html class="no-js ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8"/>