Skip to content

Instantly share code, notes, and snippets.

View inkel's full-sized avatar
:shipit:
The floating head with a beard

Leandro López inkel

:shipit:
The floating head with a beard
View GitHub Profile
@inkel
inkel / gist:3939084
Created October 23, 2012 14:33
redis.conf notes
Via: http://news.ycombinator.com/item?id=4686338
https://gist.github.com/3932768
https://gist.github.com/3933451
https://gist.github.com/3934073
https://gist.github.com/3935007
https://gist.github.com/3935671
Redisconf Notes:
@inkel
inkel / ruby-no-cflags.txt
Created December 1, 2012 12:08
Benchmark for comparison of homebrew's ruby with and without CFLAGS="-march=native -O3"
>> /usr/bin/time -l ruby thebench.rb 30 1000
Rehearsal --------------------------------------------------------
fib(30) 0.260000 0.000000 0.260000 ( 0.255475)
1000 tempfiles 0.120000 0.250000 0.370000 ( 0.429621)
----------------------------------------------- total: 0.630000sec
user system total real
fib(30) 0.260000 0.000000 0.260000 ( 0.259108)
1000 tempfiles 0.130000 0.270000 0.400000 ( 0.848950)
@inkel
inkel / deidad.md
Last active October 13, 2015 12:18
Vikintismo

Deidad

Nuestra deidad es el Vikindín, Supremo Ser del Panteón Cervecístico al elevarse el Viejo Viky y tomar las Barbas de Odín.

Vikydín

Los cuernos son opcionales, aunque puede servir de porrones portátiles.

@inkel
inkel / gist:4991057
Last active December 13, 2015 23:19
backup a redis database
#! /usr/bin/env ruby
#
# -*- mode: ruby -*-
# Backup Redis database
#
# This should be placed in the crontab, as in the following example
# (hourly backups)
#
# 0 * * * * /path/to/backup
#
@inkel
inkel / life.go
Created May 30, 2013 11:16
Game of Life, in Go
// Original http://play.golang.org/p/wyxEQ9RRPD
package main
import (
"bytes"
"fmt"
"math/rand"
"time"
)
#! /usr/bin/env ruby
BIN = "hipchat".freeze
USAGE =<<EOS
#{BIN}(1)
NAME
#{BIN} -- Simple interface to HipChat
require_relative "./users"
require_relative "./posts"
Cuba.use JSONAllTheThings
Cuba.define do
on "users" do
run Users
end
@inkel
inkel / include_vs_cover.rb
Created July 26, 2013 18:12
Benchmark Ruby's Range#cover? vs Enumerable#include?
#! /usr/bin/env ruby
require "benchmark"
SET = (1..100)
N = (ARGV[0] || 1_000_000).to_i
Benchmark.bm(22) do |r|
r.report("#include? - best case") do
N.times { SET.include?(1) }