Skip to content

Instantly share code, notes, and snippets.

View nmerouze's full-sized avatar

Nicolas Mérouze nmerouze

View GitHub Profile
Post.blueprint do
title "I like MongoDB!"
body "I have a ton of reasons for that."
end
$(function() {
$.getJSON("http://search.twitter.com/search.json?&q=appcelerator&rpp=10&callback=?", function(json) {
var data = _.map(json.results, function(item) {
return { text:item.text, image:item.profile_image_url };
});
});
});
// With hassox' patch
require('./mustache'); // Like I do with Underscore.js
Mustache.to_html("{{title}}", { title: "Title" }); // It doesn't work
// With exports.to_html = Mustache.to_html; in mustache.js
var Mustache = require('./mustache');
Mustache.to_html("{{title}}", { title: "Title" }); // It works
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>My Framework</title>
</head>
<body>
./to_pdf -n 27 http://nmerouze.github.com/blockcampparis09
$.getJSON("http://search.twitter.com/search.json?&q=from:nmerouze&callback=?", function(data) {
});
class User
include MongoMapper::Document
devise :authenticatable, :rememberable
key :email, String
key :encrypted_password, String
key :password_salt, String
key :remember_token, String
key :remember_created_at, DateTime
timestamps!
Ruby 1.8.6 w/o C extension
==========================
user system total real
single object inserts: 3.450000 0.160000 3.610000 ( 3.779446)
multiple object insert: 2.190000 0.020000 2.210000 ( 2.223418)
find_one: 0.070000 0.000000 0.070000 ( 0.087103)
Ruby 1.8.6 w/ C extension
=========================
user system total real
# MongoDB Java driver vs Ruby Driver with JRuby 1.3.1
#
# user system total real
# java driver (find) 2.266000 0.000000 2.266000 ( 2.266000)
# ruby driver (find) 6.790000 0.000000 6.790000 ( 6.790000)
# java driver (create) 0.602000 0.000000 0.602000 ( 0.602000)
# ruby driver (create) 3.963000 0.000000 3.963000 ( 3.963000)
require "java"
require "benchmark"
# http://github.com/giraffesoft/resource_controller/tree/master
### Exemple
class MoviesController < ResourceController::Base
end