Skip to content

Instantly share code, notes, and snippets.

View puttputt's full-sized avatar

kyle smyth puttputt

View GitHub Profile
#opens a file, outputs image url's to it
file = File.open("url.txt", "r+")
for i in (582...660)
file.puts "http://www.domain.com/" << i.to_s() << ".png"
end
file.close

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

@puttputt
puttputt / TweetReel API Get?.rb
Created July 22, 2009 16:18
a Ruby script that grabs a given user's TweetReel media.
require 'rubygems'
require 'open-uri'
require 'json'
require 'net/http'
#what user?
username = 'kylesmyth'
#form url and get JSON
url = 'http://search.twitter.com/search.json?q='+ username +'+tweetreel.com'
@puttputt
puttputt / jtv.php
Created May 26, 2011 02:37
Check if justin.tv stream is live, display if it is
<?
//Script for Saskgamers.com
//Determines if a user's justin.tv stream is online, then displays it if it is
//To add more streams add the justin.tv channel id to the $streams array
$chan = "";
$streams = array(
"puttly", "j4sh", "strainkiss", "milfhunter", "gorgenzola", "steven_bonnell_ii"
);
echo "<span class=\"smalltext\"><strong>Live User Streams:</strong> ";
foreach ($streams as &$i) {
info: Welcome to Nodejitsu canadalive
info: jitsu v0.13.2, node v0.10.4
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
warn:
warn: The package.json file is missing required fields:
warn:
warn: Subdomain name, scripts.start
warn:
warn: Prompting user for required fields.
$project: {
year: { $year: '$time'},
month: { $month: '$time'},
day: { $dayOfMonth: '$time'},
hour: { $hour: '$time'},
price: 1,
volume: 1,
}
$group : {
_id: { year: '$year', month: '$month', day: '$day', hour: '$hour' },
price:{
$avg: "$price"
},
volume:{
$sum: "$volume"
}
map = function(){
var quarter;
var mins = this.time.getMinutes();
if(mins <= 14)
quarter = 0;
else if(mins<=29)
quarter = 15;
else if(mins<=44)
quarter = 30;
else
reduce = function(key, values) {
var prices = 0.0;
var volume = 0.0;
var total = 0.0;
var high = values[0].price;
var low = values[0].price;
var count = 0;
values.forEach(function(value)
{
prices += value.price;
var o = {};
o.map = map;
o.reduce = reduce;
if(time!=null)
{
o.query = {time: {$gte: time}};
}
collection.mapReduce(o, function(err,result) {