Skip to content

Instantly share code, notes, and snippets.

@mattmanning
mattmanning / gist:1430691
Created December 4, 2011 17:02
Fixing Apachebench on OS X Lion
If you're getting this error trying to use ApacheBench on OS X Lion:
Benchmarking mwmanning.com (be patient)...apr_socket_recv: Connection reset by peer (54)
You need to download the latest beta version of Apache and rebuild ab. Here's how (assuming you have homebrew installed).
brew install pcre
tar xzvf httpd-2.3.15-beta.tar.gz
cd httpd-2.3.15-beta
./configure
Dear Matt,
Thank you for contacting Online Support.
Go Daddy is the world’s largest domain name registrar with more than 50 million domain names in our portfolio. Go Daddy has a full time presence in Washington D.C. and takes an active role in Congressional and legislative proposals.
Included in Go Daddy’s legislative efforts is the Stop Online Piracy Act (SOPA). We are currently reviewing the most recent legislative proposal and continue to educate ourselves on the many facets of SOPA. We look forward to working with Congress to refine legislative language about this issue when appropriate.
To review Go Daddy's statement on the matter, you can read this article:
class Array
def inc(val)
map {|e| e + val}
end
end
def add1(arr, val, n)
case n <=> 0
when 0
arr.inc(val)
@mattmanning
mattmanning / pi.rb
Created August 6, 2012 20:30
Estimate pi using random points and the distance formula
#!/usr/bin/env ruby
#
# Estimate pi using 1 random point:
# ./pi.rb 1
#
# Estimate pi using 1000 random points:
# ./pi.rb 1000
class Point
def initialize
@mattmanning
mattmanning / vim questions
Last active December 29, 2015 12:09
I'm trying to learn vim. These are unanswered questions I have.
I use the "find in project" feature of TextMate a lot. What's a good vim plugin for that? I can fall back on grep on the terminal, but it would be nice to do it in the editor and open files directly from search results.
Is there any way to do fuzzy filename matching / completion with the :edit command?
How do I get it to handle indentations in Ruby code correctly? (2 spaces soft tabs)

Keybase proof

I hereby claim:

  • I am mattmanning on github.
  • I am mattmanning (https://keybase.io/mattmanning) on keybase.
  • I have a public key whose fingerprint is D38E DA93 16C3 86D4 3B6D 3630 2842 8B94 6FE4 686D

To claim this, I am signing this object:

Baseball Stars
Battletoads
Bionic Commando
Blaster Master
Bubble Bobble
Castlevania 2 - Simon's Quest
Castlevania III: Dracula's Curse
Castlevania
Contra
Crystalis
-----BEGIN PGP MESSAGE-----
Version: GnuPG v1
hQEMAyolo95N7fZGAQf/ZdJBUQsDTe/kIz+wzYv21wzIp5HQV62G8dxVTd9VFZ6R
Zu/Q+WWuwzE70Cykh7bkO4uPVhQhuYciw7iGVkuKqtN/2besBn59jzc6h1nlbcX2
76tsHfCZ9nnyTH8Q+Heav+E9d3blxZol3FjQGuTecjNpA3M6Ljq6GgI7KFL2B4JW
5aBBIoyyi9SScP9+PAof5FRpzMsuVqIzrdFwyeR6Bh0+1KBqfy9WZ0p6v/67eBnw
dFGyx9mXJ70Wvrm3LBqScGNNEocKC+OLlpfV4s2m3TZCNRz9HBivHmBVYSrZtfVs
eXWpVxxoVX0kFI06g0wnqUfb3oAYr5FLOdyH61akb9I3ARW7dadkVrifmKLb85KN
fVW1rDzxvL3qaymdaME+Y8NZ1iPES26TEZ9vK+tL00gSmjB/yV7CCw==

Making Your Own Blog

This tutorial will walk you through making your own blog. To build it, we're going to use the Ruby programming language and a web library for it called Sinatra.

Getting started

Before we start we need to install a couple of tools. Ruby is an "interpreted" programming language, so we'll install a special program called an interpreter that will run your Ruby code. The installer also includes some other tools that help you out when building Ruby programs.

Hello World!