Skip to content

Instantly share code, notes, and snippets.

View ouyangzhiping's full-sized avatar

Zhiping Yang ouyangzhiping

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.

import twitter
import networkx as NX
import time
# Create an authenticated Api object in order to download user data
api_user='your_twitter_id'
api_pswd='your_twitter_password'
api=twitter.Api(username=api_user,password=api_pswd)
# The seed user to be analyzed
@psousa
psousa / restfull controller textmate snippet
Created June 27, 2009 11:45
snippet for resftull controllers in rails. Scope selector: source.ruby.rails
def index
@${1:things} = ${2:Thing}.find :all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @$1 }
end
end
def show
~$ ARCHFLAGS='-arch i386 -arch x86_64'
~$ rvm install 1.8.7 --debug --reconfigure -C --enable-shared=yes
~$ wget http://sourceforge.net/projects/rubycocoa/files/RubyCocoa/1.0.0/RubyCocoa-1.0.0.tar.gz/download
~$ tar xzf RubyCocoa-1.0.0.tar.gz && rm RubyCocoa-1.0.0.tar.gz && cd RubyCocoa-1.0.0
~/RubyCocoa-1.0.0$ ruby install.rb config --build-universal=yes
~/RubyCocoa-1.0.0$ ruby install.rb setup
~/RubyCocoa-1.0.0$ sudo ruby install.rb install
#!/usr/bin/ruby -w
require 'socket'
server = TCPServer.open(7788)
loop do
Thread.start(server.accept) do |client|
client.write "[Host]:[Port]> "
target = ""
while s = client.getc.chr
client.write s
# zh-CN translations for Typus (template)
# by ZoOL <http://github.com/zhooul>
zh-CN:
"A valid token is required": "需要验证令牌"
"Actions": "动作"
"Active": "已激活"
"Add": "新增"
"Add %{resource}": "新增 %{resource}"
"Add new": "新增"
@bmuller
bmuller / r.rb
Created January 3, 2011 19:05
r.rb
require 'formula'
class R <Formula
url 'http://cran.r-project.org/src/base/R-2/R-2.12.1.tar.gz'
homepage 'http://www.R-project.org/'
md5 '078e8d1179fc9a762e326e6da2725468'
depends_on 'readline'
def install
@rguggemos
rguggemos / Kaminari ajax pager
Created March 18, 2011 17:33
Kaminari ajax pager
If you switch to kaminari,
http://railscasts.com/episodes/254-pagination-with-kaminari
...the lines added to application.js become redundant when you implement the pager like in this demo project:
https://github.com/amatsuda/kaminari_example/tree/ajax
in index.html:
@evtuhovich
evtuhovich / .irbrc
Created March 22, 2011 11:33
My Irbrc file
require 'rubygems'
# Rails on-screen logging
def change_log(stream)
ActiveRecord::Base.logger = Logger.new(stream)
ActiveRecord::Base.clear_active_connections!
end
def show_log
@dvhthomas
dvhthomas / Markdown.sublime-build
Created May 3, 2011 22:58
Pandoc powered Sublime Text 2 build provider for Markdown files: HTML the easy way
{
"cmd": ["pandoc.exe", "--to=html", "--output=$file.html", "$file"],
"selector": "source.md"
}