Skip to content

Instantly share code, notes, and snippets.

Avatar

brian piercy bjpcjp

View GitHub Profile
View stackoverflow_spider.py
import scrapy
class StackOverflowSpider(scrapy.Spider):
name = 'stackoverflow'
start_urls = ['http://stackoverflow.com/questions?sort=votes']
def parse(self, response):
for href in response.css('.question-summary h3 a::attr(href)'):
View nodejs setup on Dreamhost VPS
1) Make a download dir to store the node source and download it.
mkdir downloads
cd downloads
git clone https://github.com/joyent/node.git
Find the latest version
2) List all of the tags in the repository, and check out the most recent.
git tag
git checkout v0.9.9
@bjpcjp
bjpcjp / denominator-snippet.rb
Created Sep 12, 2012 — forked from rweald/denominator-snippet.rb
Code Snippets for Simple Linear Regression Using Ruby Blog Post
View denominator-snippet.rb
denominator = @xs.reduce(0) do |sum, x|
sum + ((x - x_mean) ** 2)
end