Discover gists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
show me what you post, gist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
posting from Emacs... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
what if I want XML back? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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/') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# exercise of backtracking algorithm. | |
# 2008.07.26 | |
# | |
require 'pp' | |
# (x, y) のマスに置けるか | |
def test(x, y, board) | |
x.times do |i| | |
# 左 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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; | |