Skip to content

Instantly share code, notes, and snippets.

@erikbuild
erikbuild / gist:940095
Created April 25, 2011 02:57
Simple IRC Bot in Ruby
require 'rubygems'
require 'ponder'
require 'wikipedia'
@ponder = Ponder::Thaum.new
@ponder.configure do |c|
c.nick = 'FUN_BOT'
c.username = 'FUN_BOT'
c.real_name = 'FUN_BOT'
class ClocksController < ApplicationController
# GET /clocks
# GET /clocks.xml
def index
@clocks = current_user.clocks.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @clocks }
end
require 'rubygems'
require 'prawn'
require 'prawn/core'
require 'prawn/layout'
require 'fastercsv'
require 'awesome_print'
# Parse the CSV
residents = FasterCSV.read("residents.csv")
ap residents
@erikbuild
erikbuild / gist:1179772
Created August 30, 2011 00:19
hg visual studio 2010 gitignore
# use glob syntax
syntax: glob
*.obj
*.exe
*.pdb
*.user
*.aps
*.pch
*.vspscc
I don't see how this:
if (foo)
{
// something
}
is more readable than this:
if (foo) {
module ApplicationHelper
def markdown(text)
Redcarpet.new(text).to_html.html_safe
end
end
[Wed, 02 Nov 2011 03:18:46 +0100] INFO: *** Chef 0.10.4 ***
[Wed, 02 Nov 2011 03:18:46 +0100] INFO: Setting the run_list to ["enterprise-configure"] from JSON
[Wed, 02 Nov 2011 03:18:46 +0100] INFO: Run List is [recipe[enterprise-configure]]
[Wed, 02 Nov 2011 03:18:46 +0100] INFO: Run List expands to [enterprise-configure]
[Wed, 02 Nov 2011 03:18:46 +0100] INFO: Starting Chef Run for enterprise-11-10-23-i386
[Wed, 02 Nov 2011 03:18:46 +0100] ERROR: Running exception handlers
[Wed, 02 Nov 2011 03:18:46 +0100] ERROR: Exception handlers complete
[Wed, 02 Nov 2011 03:18:46 +0100] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[Wed, 02 Nov 2011 03:18:46 +0100] FATAL: ArgumentError: wrong number of arguments (0 for 1)
Options +FollowSymlinks
RewriteEngine on
RewriteRule * /?page=$1 [NC]
sudo mate yourusername.conf
You will see this:
<Directory "/Users/yourusername/Sites/">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Nginx / Passegener tries to grab the wrong URL for PCRE.
To fix:
cd /home/gitlabhq
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.13.tar.gz && tar xvf pcre-8.13.tar.gz
wget http://nginx.org/download/nginx-1.0.11.tar.gz && tar xvf nginx-1.0.11.tar.gz
Re-run "sudo passenger-install-nginx-module" and choose option 2.