Skip to content

Instantly share code, notes, and snippets.

View mhat's full-sized avatar

Matt Knopp mhat

  • Mode Analytics
  • San Francisco, CA
View GitHub Profile
Darwin Endless-Waltz.local 10.2.0 Darwin Kernel Version 10.2.0: Tue Nov 3 10:37:10 PST 2009; root:xnu-1486.2.11~1/RELEASE_I386 i386
ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.2.0], MBARI 0x6770, Ruby Enterprise Edition 2009.10
------------------------------------------------------------------------------
--
map with block vs &: -- iterations by powers of 10
##############################################################################
user system total real
## 10^0
simply-S 0.000000 0.000000 0.000000 ( 0.000022)
times gc'ed: 0
require 'benchmark'
puts `uname -a`
puts `ruby --version`
puts '-' * 78
@small = (0 .. 10).to_a
@exps = []
GC.enable_stats
Matt@Endless-Waltz$ ./script/console
Loading development environment (Rails 2.3.2)
/Users/Matt/Hacking/workfeed/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:99:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010. Use #requirement
>> require 'cassandra'
NameError: uninitialized constant Connection::Base
from /Users/Matt/Hacking/workfeed/vendor/rails/activesupport/lib/active_support/dependencies.rb:440:in `load_missing_constant'
from /Users/Matt/Hacking/workfeed/vendor/rails/activesupport/lib/active_support/dependencies.rb:80:in `const_missing'
from /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/gems/1.8/gems/thrift_client-0.4.0/lib/thrift_client/connection/socket.rb:2
from /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /opt/ruby-enterprise-1.8.7-2009.10/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
@mhat
mhat / a-guide.markdown
Created August 15, 2010 23:11
rolling with homebrew

Rolling with HomeBrew (rather than MacPorts)

First things first, we have to install HomeBrew. Once installed we can do pretty much everything else via HomeBrew. By default HomeBrew will install to /usr/local. It's possible to choose a different directory but everything I've read so far says it's a PITA. I'm sticking with the default.

ruby -e "$(curl -fsS http://gist.github.com/raw/323731/install_homebrew.rb)"

Getting your development environment running requires a few servers. You could get by with as little as Postgres and Memcached but it'll be better if you have Nginx and RabbitMQ as well. Eventually you'll probably want Redis and Artie as well.

TODO: instructions for Redis and Artie

step 1: edit the redis formula

brew edit redis 

then change

url 'http://redis.googlecode.com/files/redis-2.0.0-rc4.tar.gz'
sha1 'b2fda3b2a073c537c324b962ba0c7c81be8baef3'
USE_SSL = true
HTTP_PROTOCOL = "https://"
nginx.conf
http://gist.github.com/596511
openssl-bs
http://gist.github.com/596510
developer.rb
http://gist.github.com/596497
cd /usr/local/etc/nginx
mkdir ssl
cd ssl
openssl genrsa -out server.key 1024
openssl req -new -key server.key -out server.csr
US
California
SF
Yammer
user nobody;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
Listen 443
<VirtualHost *:80>
RewriteEngine On
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</VirtualHost>
<VirtualHost *:443>
ServerName yammer.local
ServerAlias ymodules.local