Skip to content

Instantly share code, notes, and snippets.

ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA0L8ZLq6XbWgDJFTk5RE+hvGKCPHk7OuAME666HgeoG1uBYpUOu9W9OTOoUpSVA1fEsT9v1Q5y39gPoExGknqLEKm7DWQ8j8gITLI9u/pN5W6Mk8n9WzSbn0e9iymjdO7SyUH5y2V+vWjlAeb9RfSY+cpcVpfdVdQ+SaoOGRtr90pGO6Lgun5z2Kh+bgN2D0flQ4uVF+akG2FRZjUL74Slmdgqnji6SODBXemyAsKLx2dLkYVuVHmDYIkFoqDEqxQQ0H0d7oVYp82tsQgm/Q0znVAnZ/Kw18POuUu5hdbsQ5OVA+mhf8KoylAD6Doe2BDi39vJqOZ3U20q0OV2/a6cQ== matthew@redhouse.local
@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)

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!

Baseball Stars
Battletoads
Bionic Commando
Blaster Master
Bubble Bobble
Castlevania 2 - Simon's Quest
Castlevania III: Dracula's Curse
Castlevania
Contra
Crystalis
@mattmanning
mattmanning / postgres_queries_and_commands.sql
Created June 18, 2018 19:45 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'