Skip to content

Instantly share code, notes, and snippets.

View desandro's full-sized avatar

David DeSandro desandro

View GitHub Profile
@desandro
desandro / index.html
Created July 30, 2012 03:57
A web page created at CodePen.io.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Google WebFont Loader test &middot; CodePen</title>
<!--
Copyright (c) 2012 David DeSandro, http://codepen.io/desandro
Permission is hereby granted, free of charge, to any person obtaining
@desandro
desandro / uppercase-command.js
Created June 5, 2012 15:55
To uppercase TextMate node command
#!/usr/bin/env node
process.stdin.resume();
var str = '';
process.stdin.on( 'data', function ( chunk ) {
str += chunk;
});
@desandro
desandro / command.js
Created June 5, 2012 15:15
basic TextMate command with node
#!/usr/bin/env node
// run command and it should output "hello world"
function print( str ) {
process.stdout.write( str );
}
print('hello world')
@desandro
desandro / dabblet.css
Created May 23, 2012 11:13
Pinterest layout mashed up
/* Pinterest layout mashed up */
/* ----------------------------> See Line 8 of CSS for instructions of how the layout mashes up with Masonry */
div.statcol{ float: left; padding: 0px; vertical-align: middle; overflow: hidden; text-align: left; margin-bottom: 42px; }
/* div.statrow{ padding-top: 0px; vertical-align: middle; clear: both; float: none; } */
div.statrow { width: 100%; margin: 0 auto; overflow: hidden; }
.polaroid { padding: 10px 10px 19px 10px; background-color: #f7f7f7;
display: inline-table; font-style: italic; line-height: 1.45em; }
.statcol:nth-child(4) { padding-bottom: 40px; clear:both; }
.statcol { text-align: center; }
@desandro
desandro / dabblet.css
Created May 11, 2012 17:21
border-radius: 50%;
/**
* border-radius: 50%;
*/
div {
background: #888;
margin: 10px;
border-radius: 50%;
}
@desandro
desandro / jquery.isotope-masonry-column-shift-gutters.js
Created May 6, 2012 20:10
Isotope Masonry column shift w/ gutters custom layout mode
$.Isotope.prototype._getMasonryColumnShiftColumns = function() {
var gutter = this.options.masonryColumnShift && this.options.masonryColumnShift.gutterWidth || 0;
containerWidth = this.element.width();
this.masonryColumnShift.columnWidth = this.options.masonryColumnShift && this.options.masonryColumnShift.columnWidth ||
// or use the size of the first item
this.$filteredAtoms.outerWidth(true) ||
// if there's no items, use size of container
containerWidth;
@desandro
desandro / jquery.masonry-0.6.js
Created March 26, 2012 18:15
Early jQuery Masonry
(function($){
//Finding min and max values in array from http://snippets.dzone.com/posts/show/769
Array.prototype.min = function(){ return Math.min.apply({},this) };
Array.prototype.max = function(){ return Math.max.apply({},this) };
$.fn.masonry = function() {
this.each(function() {
var wall = $(this);
error: object directory ./objects/../../data/repositories/0/nw/05/19/95/1211978/network.git/objects does not exist; check .git/objects/info/alternates.
@desandro
desandro / index.html
Created February 27, 2012 04:21
Safari 5 3D overflow bug
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>backface visibility bug</title>
<style>
body {
font-family: sans-serif;
@desandro
desandro / README.markdown
Created February 24, 2012 15:17
addTap.js

addTap

helper function for adding click-ish events for touch devices

Usage

addTap( elem, onTap, options );

// for example

var box = document.getElementById('box');