Skip to content

Instantly share code, notes, and snippets.

View dandean's full-sized avatar
🌧️
It's raining.

Dan Dean dandean

🌧️
It's raining.
View GitHub Profile
<div className="pricing" style={{ opacity: purchasing ? 0.25 : '' }}>
<Conditional if={purchaseComplete}>
<div className="purchase-complete">
<h2>Thanks!</h2>
<p>
Thank you for your purchase of {formatPrice(this.state.total)}.
We’ll send you a receipt shortly.
</p>
<p>
<button
@dandean
dandean / hash_converter.rb
Created October 3, 2012 05:48 — forked from timruffles/hash_converter.rb
rails hash formatter - hash/json to/from camel case and underscores
module HashConverter
class << self
def to_underscore hash
convert hash, :underscore
end
def to_camel_case hash
convert hash, :camelize, :lower
end
def convert obj, *method
case obj
@dandean
dandean / gist:956063
Created May 4, 2011 21:21 — forked from fling/gist:956023
Page Control CSS
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=724, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<title>Page Control</title>
<style>
var TitleWrapper = function()
{
/* .
. Blah blah blah
. */
var onMute = function()
{
<!DOCTYPE html>
<html lang="en">
<head>
<script type="text/javascript" src="soundmanager/script/soundmanager2.js"></script>
<script type="text/javascript" src="index.js"></script>
<title>Grrrr!</title>
</head>
<body>
<p id="debug1">Nothing works! &hearts;</p>
var App = function() {
var musicLoopFlag = 0,
delay = null,
frameNumber = 0,
afterFirstLoop = 0,
self = this;
this.setup = function() {
var assetCount = 59; // One for each image in the animation, plus one for the intro and one
// for the loop of the song
@dandean
dandean / gist:552319
Created August 26, 2010 21:45 — forked from gf3/gist:166083
// Truncate a string to the closest word
String.prototype.truncateToWord = function(length) {
return this
.slice(0, length + 1)
.split(/\s+/)
.slice(0, -1)
.join(" ");
};
// Examples
so my workflow is that each ticket gets a branch. Before merging the branch to master
it needs to be peer-reviewed. So sometimes I have a bunch of branches that are off
being reviewed while I work on something else.
Currently when I run "git branch" I see:
[branch 1]
[branch 2]
[branch 3]
*[branch 4]
[branch 5]

(This is the text of the keynote I gave at Startup Riot 2009. Will update when video becomes available.)

Hi everyone, I’m Chris Wanstrath, and I’m one of the co-founders of GitHub.

GitHub, if you haven’t heard of it, has been described as “Facebook for developers.” Which is great when talking about GitHub as a website, but not so great when describing GitHub as a business. In fact, I think we’re the polar opposite of Facebook as a business: we’re small, never took investment, and actually make money. Some have even called us successful.

Which I’ve always wondered about. Success is very vague, right? Probably even relative. How do you define it?

After thinking for a while I came up with two criteria. The first is profitability. We employ four people full time, one person part time, have thousands of paying customers, and are still growing. In fact, our rate of growth is increasing – which means January was our best month so far, and February is looking pretty damn good.

// Untested. Requires Prototype >= 1.6
//
// Copyright (c) 2009 Tobie Langel
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions: