Skip to content

Instantly share code, notes, and snippets.

Over the past week, Merb has been working on merging our core extension library
with DataMapper's, to provide a single non-conflicting library for both Merb
and DataMapper to use. Unfortunately, it has caused some confusion for people
who use edge merb but do not really dive into development process.
Here's what changed and why:
* Merb core extensions and support classes were extracted into merb-extlib.
* merb-extlib was merged with DataMapper's extlib on a separate branch.
* merb-core, merb-more, merb-plugins all have a branch where the merged extlib
show me what you post, gist
@jeremyBanks
jeremyBanks / pi.py
Created July 27, 2008 06:49
Simple π calculation [2010-01] (from Pythagorean theorem)
#!/usr/bin/env python
# encoding: utf-8
from __future__ import division, with_statement
import sys
from math import sqrt, pi
def calculatePi(samples):
samples = int(samples)
posting from Emacs...
what if I want XML back?
Merb.logger.info("Compiling routes...")
Merb::Router.prepare do |r|
# RESTful routes
r.resources :songs
# This is the default route for /:controller/:action/:id
# This is fine for most cases. If you're heavily using resource-based
# routes, you may want to comment/remove this line to prevent
#!/usr/bin/env ruby
require 'pit'
require 'mechanize'
require 'uri'
pit = Pit.get('github', :require => {
'username' => 'username',
'password' => 'password'})
BASE = URI('http://gist.github.com/')
#!/usr/bin/perl
use strict;
use Web::Scraper;
use URI;
my $uri = URI->new("http://dann.g.hatena.ne.jp/keywordlist");
my $scraper = scraper {
process '//div[@class="refererlist"]/ul/li/a', 'keywords[]' => {
name => 'TEXT',
url => '@href',
@mootoh
mootoh / gist:2766
Created July 27, 2008 08:37
バックトラック法による 8クイーンの解法
#
# exercise of backtracking algorithm.
# 2008.07.26
#
require 'pp'
# (x, y) のマスに置けるか
def test(x, y, board)
x.times do |i|
# 左
#!/usr/bin/env perl
use strict;
use warnings;
use WebService::Simple;
use Digest::MD5 qw(md5_hex);
use Path::Class qw(dir);
use Perl6::Say;
use HTTP::Async;
use HTTP::Request;