Skip to content

Instantly share code, notes, and snippets.

View cezarsa's full-sized avatar

Cezar Sá Espinola cezarsa

  • Brasília - DF / Brazil
  • 21:56 (UTC -03:00)
View GitHub Profile
@cezarsa
cezarsa / robot.js
Created November 30, 2012 02:31
test
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
// robot.ahead(100);
@cezarsa
cezarsa / robot.js
Created November 30, 2012 02:38
test2
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(100);
@cezarsa
cezarsa / robot.js
Created November 30, 2012 16:36 — forked from heynemann/robot.js
seeker
var robotData = {};
var isClone = function(r) {
return !!r.parentId;
};
var isRelated = function(r1, r2) {
return r1.id == r2.parentId || r1.parentId == r2.id;
};
var set = function(r, k, v) {
robotData[r.id] = robotData[r.id] || {};
robotData[r.id][k] = v === undefined ? true : v;
@cezarsa
cezarsa / robot.js
Created December 1, 2012 01:23
Kaiju Banzai
function Robot(robot) {}
Robot.status = 0;
Robot.enemy = {};
Robot.enemy.posX;
Robot.enemy.posY;
Robot.enemy
// well, we need to do something...
// whenever our robot is idle, this method gets called.
Robot.prototype.onIdle = function(ev) {
@cezarsa
cezarsa / dabblet.css
Created February 25, 2013 18:43
Untitled
div {
width: 0;
border-right: 10px solid #000;
border-top: 10px solid transparent;
border-bottom: 10px solid transparent;
position: relative;
}
@cezarsa
cezarsa / dabblet.css
Created April 30, 2013 21:00
Untitled
div {
box-shadow:
0 -1em 0 1px #000,
0 -2em 0 1px #000,
0 1em 0 1px #000,
0 2em 0 1px #000,
-1em 0 0 1px #000,
-2em 0 0 1px #000,
1em 0 0 1px #000,
2em 0 0 1px #000;
require File.expand_path('../boot', __FILE__)
# require 'rails/all'
require "action_controller/railtie"
require "action_mailer/railtie"
require "rails/test_unit/railtie"
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env)
$ t app-create sample buildpack
App "sample" is being created!
Use app-info to check the status of the app and its units.
Your repository for "sample" project is "git@192.168.50.4:sample.git"
(sample)[14:00] cezar.sa@dagobah [/.../code/tsuru/sample_app] (master)
$ git push tsuru master
Counting objects: 63, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (47/47), done.
Writing objects: 100% (63/63), 6.51 KiB | 0 bytes/s, done.

After creating an index in a capped collection, sorting it in reverse natural order doesn't work anymore.

$ mongod --version
db version v2.6.1
2014-06-05T13:45:27.884+0000 git version: 4b95b086d2374bdcfcdf2249272fb552c9c726e8

This works fine and as expected:

package main
import (
"fmt"
"github.com/garyburd/redigo/redis"
"time"
)
func main() {
pool := &redis.Pool{