Skip to content

Instantly share code, notes, and snippets.

David DeSandro desandro

Block or report user

Report or block desandro

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View twitter-nix.css
/* sidebars */
/* in timeline */
.WtfLargeCarouselStreamItem, /* WTF in timeline */

Hello █████,

Thanks for getting in touch and for this tremendous invitation. I'm flattered and excited by the offer.

Representation matters to me. I'm curious: How are you aiming to build a diverse speaker line-up this year? Last years's conference only had 1 female and 1 person of color.

My inclusion rider: I'll join as a speaker if the line-up includes at least ██ women and ██ POC.

I realize putting together a diverse line-up is difficult. As a white male, I'd rather not take up a slot that could better feature someone not like me. Here's a list of people I can recommend.

View calebs-first-code.txt
uijjkjn bnnbbv 7nbgn7uy8mh vb hx vghb Z bv VB Aszxsew2W
sxez3w axzas bf71b 1vfu1ch bc bgb7nvi 76r g `cxzfbc cv
dfgv n 1 2q1
View penrose.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
desandro / elephant.svg
Created Feb 24, 2017
overprint elephant
View elephant.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View round-svg.js
var paths = document.querySelectorAll('path')
for ( var i=0; i < paths.length; i++ ) {
var path = paths[i];
var d = path.getAttribute('d');
// 10.2.3 -> 10.2 0.3
d = d.replace( /(\d?\.\d)\.(\d)/g, function( match, $1, $2 ) {
return $1 + ' 0.' + $2
// round numbers
desandro / conditionals.js
Created May 19, 2016
hash table vs. conditionals
View conditionals.js
// Get 1st, 2nd, 3rd, 4th, from 1, 2, 3, 4
// ignoring 11, 12, 13 for demo
// using conditionals
function suffixDate( date ) {
var lastDigit = date % 10;
if ( lastDigit == 1 ) {
return date + 'st';
} else if ( lastDigit == 2 ) {
return date + 'nd';

I've been struggling to come up with a good answer to this question: What is good code?

Programming is such a technical subject. It appears to be something you can definitively analyze. But when I think about it through this question, programming seems entirely subjective.

I know good code can be readable, terse, eloquent, standardized, innovative. But it can't be just one of these qualities.

Good code can be highly stylized — utilizing nuanced patterns rarely seen elsewhere. Or good code can be highly structured — following strict guidelines and established conventions. Bad code can be either as well.

I think the answer to "What is good code?" is that there is no answer. You can't put it in words. Like asking "What makes a joke funny?"


Ask Reddit: Have you ever felt a deep personal connection to a person you met in a dream only to wake up feeling terrible because you realize they never existed?

throw away account cause this is really personal.

My last semester at a certain college I was assulted by a football player for walking where he was trying to drive (note he was 325lbs I was 120lbs), while unconscious on the ground I lived a different life.

I met a wonderful young lady, she made my heart skip and my face red, I pursued her for months and dispatched a few jerk boyfriends before I finally won her over, after two years we got married and almost immediately she bore me a daughter.

You can’t perform that action at this time.