Skip to content

Instantly share code, notes, and snippets.

View altamic's full-sized avatar

Michelangelo Altamore altamic

View GitHub Profile
@defunkt
defunkt / startupriot.markdown
Last active September 15, 2023 18:11
Startup Riot 2009 Keynote

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

# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
@woodie
woodie / gist:464939
Created July 6, 2010 02:55
Working with int[] and String[]
# this is an array
$ duby -e "a = int[5]
a[0] = 3
a[1] = 4
a[4] = 8
puts a.each {|i| puts i}"
3
4
0
0
/*
* def.js: Простое наследование в стиле Ruby для Javascript
*
* Copyright (c) 2010 Tobias Schneider
* This script is freely distributable under the terms of the MIT license.
*/
(function(global) {
// Используется, чтобы сохранить суперкласс и "плагины" ля
// дальнейшего использования
@woodie
woodie / README.rdoc
Created July 22, 2010 17:02
Rails 2.3.8 on App Engine with DataMapper

Rails 2.3.8 on App Engine (DataMapper)

Do not use rvm (or install and run from JRuby). The google-appengine gem must install into your system MRI. The appengine-sdk gem includes a complete Java app server. We bootstrap Java from MRI, then your app runs inside a servlet container (with access to all the APIs) using the version of JRuby installed into each app.

We assumed Rails 2 would never work without rubygems, and we committed to gem bunlder for JRuby on App Engine, so we were waiting for Rails 3. Fortunately, Takeru Sasaki was able to patch the Rails 2.3.x calls to rubygems, and now we have it working. Rails 2.3.x currently spins up several seconds faster than Rails 3, and just a few seconds behind Sinatra.

See the TInyDS version also: gist.github.com/gists/269075

Install the Development Environment

# compl1.rb - Redis autocomplete example
# download female-names.txt from http://antirez.com/misc/female-names.txt
require 'rubygems'
require 'redis'
r = Redis.new
# Create the completion sorted set
if !r.exists(:compl)
@woodie
woodie / Gemfile .rb
Created September 18, 2010 21:42
Rails 3.0 on GAE
# Gemfile for Rails 3.0
source 'http://rubygems.org'
gem 'rails', '3.0.0'
gem 'activerecord-nulldb-adapter' # for now
gem 'jruby-openssl' # for cookie sessions
gem 'appengine-rack' # jruby-jars & jruby-rack
@manveru
manveru / stack.rb
Created September 28, 2010 11:02
Simple StringScanner solution for parsing nested braces
require 'strscan'
s = StringScanner.new("1{2{3}; 1{2} }")
stack = [[]]
until s.eos?
if s.scan(/\{/)
stack << []
elsif s.scan(/\}/)
@gotascii
gotascii / tco.rb
Created October 25, 2010 22:46
continuations via blocks and exceptions
# I got this idea from http://mihai.bazon.net/blog/redis-client-library-javascript-node
# The technique relies on the fact that raising an exception clears the call stack.
# The context is passed along with a block attached to an exception.
# I thought it was brilliant js hackery so I decided to try my hand at it in ruby.
# I've also included some other stack-dependent implementations.
# straight recursion, not quite a tail-call
# I can't go above 8.1k without stack error
def rsum(num)
if num == 0
@woodie
woodie / README.rdoc
Created November 11, 2010 00:52
Rails 2.3.10 on App Engine with DataMapper

Rails 2.3.10 on App Engine (DataMapper)

Do not use rvm (or install and run from JRuby). The google-appengine gem must install into your system MRI. The appengine-sdk gem includes a complete Java app server. We bootstrap Java from MRI, then your app runs inside a servlet container (with access to all the APIs) using the version of JRuby installed into each app.

We assumed Rails 2 would never work without rubygems, and we committed to gem bunlder for JRuby on App Engine, so we were waiting for Rails 3. Fortunately, Takeru Sasaki was able to patch the Rails 2.3.x calls to rubygems, and now we have it working. Rails 2.3.x currently spins up several seconds faster than Rails 3, and just a few seconds behind Sinatra.

See the TInyDS version also: gist.github.com/gists/269075

Install the Development Environment