Skip to content

Instantly share code, notes, and snippets.

@vapidbabble
vapidbabble / gist:e7f7e9407e6fe5a632c2
Last active August 29, 2015 14:24
Unicursal hexagram in Elm
import Color exposing (..)
import Graphics.Collage exposing (..)
import Graphics.Element exposing (..)
hexagon : Color -> Form
hexagon clr = outlined (solid clr) (ngon 6 150)
hex_on_a_point : Float -> Color -> Form
hex_on_a_point deg clr = rotate (degrees deg) (hexagon clr)
@vapidbabble
vapidbabble / daily.rb
Created December 3, 2008 16:58
takes palm docs of the dhammapada and the vacana and generates a daily reading
#takes palm docs of the buddhists texts dhammapada and the vacana and
#generates a daily reading
#get the Palm docsbooks buddhavacana.pdb and dhammapada.pdb here
#http://www.buddhavacana.net/index.php?d=/download/&f=books
# need the palm gem and chronic
require 'rubygems'
require 'palm'
require 'chronic'
require 'feedzirra'
# fetching a single feed
feed = Feedzirra::Feed.fetch_and_parse("http://feeds.feedburner.com/PaulDixExplainsNothing")
# feed and entries accessors
feed.title # => "Paul Dix Explains Nothing"
feed.url # => "http://www.pauldix.net"
feed.feed_url # => "http://feeds.feedburner.com/PaulDixExplainsNothing"
feed.etag # => "GunxqnEP4NeYhrqq9TyVKTuDnh0"

(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.

# http://www.jamesbritt.com/2007/12/18/sending-mail-through-gmail-with-ruby-s-net-smtp
# http://d.hatena.ne.jp/zorio/20060416
require "openssl"
require "net/smtp"
Net::SMTP.class_eval do
private
def do_start(helodomain, user, secret, authtype)
raise IOError, 'SMTP session already started' if @started
# http://www.jamesbritt.com/2007/12/18/sending-mail-through-gmail-with-ruby-s-net-smtp
# http://d.hatena.ne.jp/zorio/20060416
require "openssl"
require "net/smtp"
Net::SMTP.class_eval do
private
def do_start(helodomain, user, secret, authtype)
raise IOError, 'SMTP session already started' if @started
*~
*.tab.rb
coverage
# Factory girl, relaxed.
#
# Factory.define :user do |f|
# f.login 'johndoe%d' # Sequence.
# f.email '%{login}@example.com' # Interpolate.
# f.password f.password_confirmation('foobar') # Chain.
# end
#
# Factory.define :post do |f|
# f.user { Factory :user } # Blocks, if you must.
require 'rss/2.0'
require 'open-uri'
module ApplicationHelper
class EmptyURL < RuntimeError
end
def rss_content(name)
content_object = StaticContent.find_by_name(name)
if content_object.nil? || (Time.now - content_object.updated_at) > 4.hours
# Newbie Programmer
def factorial(x)
if x == 0
return 1
else
return x * factorial(x - 1)
end
end
puts factorial(6)
puts factorial(0)