Skip to content

Instantly share code, notes, and snippets.

View dcu's full-sized avatar

David Cuadrado dcu

View GitHub Profile

Keybase proof

I hereby claim:

  • I am dcu on github.
  • I am davidcuadrado (https://keybase.io/davidcuadrado) on keybase.
  • I have a public key whose fingerprint is 0288 6613 0A52 6BBF 4F34 51E7 2707 37D9 43CE ACBE

To claim this, I am signing this object:

#!/usr/bin/env ruby
require 'rest-client'
require 'time'
require 'json'
require 'bundler'
CHECK_GEMS_BEFORE = Time.parse("Feb 8, 2015")
def check_bundler
@dcu
dcu / rubyfmt.vim
Created May 9, 2015 00:32
gofmt-like vim plugin for go
if exists("b:did_ftplugin_ruby_fmt")
finish
endif
if !exists("g:ruby_fmt_commands")
let g:ruby_fmt_commands = 1
endif
if !exists("g:rubyfmt_command")
let g:rubyfmt_command = "rubocop -o /dev/null -a "
@dcu
dcu / loggers_bm.rb
Last active August 29, 2015 14:17
Ruby Loggers Benchmark
require 'buffered-logger'
require 'syslog'
require 'logger'
require 'lumberjack'
require 'chrono_logger'
require 'benchmark'
buffered = BufferedLogger.new('buffered.log')
logger = Logger.new('logger.log')
syslog = Syslog.open('rb_syslog')

Keybase proof

I hereby claim:

  • I am dcu on github.
  • I am davidcuadrado (https://keybase.io/davidcuadrado) on keybase.
  • I have a public key whose fingerprint is 0F5E 2F41 1593 87AE 56C9 E682 E3AB E2AD D5B1 5560

To claim this, I am signing this object:

@dcu
dcu / tunnel
Created July 28, 2012 23:30
ssh reverse tunneling for rails/padrino
#!/usr/bin/env ruby
require 'net/ssh'
require 'yaml'
=begin
To make this work just add "GatewayPorts yes" to /etc/sshd_config in your server
Also, make sure that config['remote_port'] is open in your server.
the config file (config/tunnel.yml) looks like this: