Skip to content

Instantly share code, notes, and snippets.

View beathyate's full-sized avatar

Gustavo Beathyate beathyate

View GitHub Profile
@beathyate
beathyate / gist:1411671
Created November 30, 2011 23:02
Comando base para OpenLDAP en Lion Server
ldapsearch -h <host.domain.tld> -p 389 -x -LLL -s sub -b "cn=Users,<dc=host,dc=domain,dc=tld>" <filter>
@beathyate
beathyate / gist:1393038
Created November 25, 2011 08:11
Sincronizador entre Macs. Requiere rsync 3.0.9 parchado.
/usr/local/bin/rsync -aNHAXx --verbose --delete --fileflags --protect-decmpfs --force-change --rsync-path=/usr/local/bin/rsync /Path/To/Folder/ remotebackups@backup.host.name:/Path/To/Folder
@beathyate
beathyate / game.rb
Created September 27, 2011 19:11
This is the rspec file of my project
class Game
attr_accessor :grid
def initialize
@grid = Hash.new
@moves = 0
9.times { |time| grid[time+1] = nil }
end
def mark(space, marker)
@beathyate
beathyate / gist:1178701
Created August 29, 2011 15:56
Coleure suggestion
$(document).bind('keydown', 'h', function() {
$hex.toggle();
}).bind('keydown', 'p', function(e){
$('.prefix').toggle();
});
@beathyate
beathyate / gist:1042706
Created June 23, 2011 15:07
Comando para firmar .mobileconfig
openssl smime -sign -in company.mobileconfig -out signed.mobileconfig -signer ipcu_pub.pem -inkey ipcu_priv.pem -certfile ipcu_pub.pem -outform der -nodetach
# _plugins/haml_converter.rb
module Jekyll
class HamlConverter < Converter
safe true
def setup
return if @setup
require 'haml'
@setup = true
# config/initializers/encodings.rb
Encoding.default_internal, Encoding.default_external = ['utf-8'] * 2
@beathyate
beathyate / Gemfile
Created December 24, 2010 07:12
Cloudmailin Rails 3 Mongoid CarrierWave GridFS
source :rubygems
gem 'rails', '3.0.3'
gem 'mongo', '1.1.5'
gem 'bson', '1.1.5'
gem 'bson_ext', '1.1.5'
gem 'mongoid', '2.0.0.beta.20'
gem 'carrierwave'
require 'openid/store/interface'
module OpenID::Store
class Association
include Mongoid::Document
field :secret, :type => Binary
def from_record
OpenID::Association.new(handle, secret.to_s, issued, lifetime, assoc_type)
end
# do not make noise
set bell-style none
# Note this must be done before the settings below
# Caveats:
# Broken on bash 3.2 (can't move cursor to EOL).
# ^L only works in command mode.
set editing-mode vi
$if Bash