This file contains hidden or 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
match("/database").to(:controller => "proxy", :action => "index" ) | |
match("/database/:id").to(:controller => "proxy", :action => "index" ) |
This file contains hidden or 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
class People | |
include DataMapper::CouchResource | |
property :id, String, :serial => true, :key => true, :field => :_id | |
property :rev, String, :field => :_rev | |
property :title, String | |
end |
This file contains hidden or 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
#include <string> | |
#include <iostream> | |
#include <boost/foreach.hpp> | |
int main() | |
{ | |
std::string hello( "Hello, world!" ); | |
BOOST_FOREACH( char ch, hello ) | |
{ |
This file contains hidden or 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
struct HelloWorld | |
{ | |
void operator()() const | |
{ | |
std::cout << "Hello, World!" << std::endl; | |
} | |
}; | |
// ... | |
This file contains hidden or 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
#include <boost/thread/thread.hpp> | |
#include <iostream> | |
int count = 0; | |
boost::mutex mutex; | |
void increment_count() | |
{ | |
boost::mutex::scoped_lock lock(mutex); | |
std::cout << "count = " << ++count << std::endl; |
This file contains hidden or 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Windows.Forms; | |
using System.Drawing; | |
namespace Simplex | |
{ | |
class Simplex |
This file contains hidden or 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
require 'rubygems' | |
require 'extlib' | |
puts "Extlib Hooks Example" | |
class ManBearPig | |
include Extlib::Hook | |
def bear? | |
puts "Nope it isn't!" |
This file contains hidden or 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
time( ls -d **/* | xargs grep TODO | awk '{print $0 "\n" }' ) | |
(; ls -d **/* | xargs grep TODO | awk '{print $0 "\n" }'; ) 0,01s user 0,01s system 102% cpu 0,019 total |
This file contains hidden or 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
time( ls -d **/* | xargs grep TODO | awk '{print $0 "\n" }' ) | |
(; ls -d **/* | xargs grep TODO | awk '{print $0 "\n" }'; ) 0,01s user 0,01s system 102% cpu 0,019 total | |
time( find -P * | xargs grep TODO | awk '{print $0 "\n" }' ) | |
(; find -P * | xargs grep TODO | awk '{print $0 "\n" }'; ) 0,00s user 0,01s system 88% cpu 0,017 total | |
time ( zargs **/* -- grep TODO | awk '{print $0 "\n" }' ) | |
(; zargs **/* -- grep TODO | awk '{print $0 "\n" }'; ) 0,00s user 0,00s system 20% cpu 0,017 total |
This file contains hidden or 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
require 'rubygems' | |
require 'aasm' | |
# show me the caller name | |
module Wombatize | |
def method_name | |
caller[0][/`([^']*)'/, 1] | |
end | |
end |