Skip to content

Instantly share code, notes, and snippets.

View tinogomes's full-sized avatar
😀

Celestino Gomes tinogomes

😀
View GitHub Profile
<div style="width:400px;overflow:auto">
<h2>This comes from ajax request</h2>
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean non velit. Donec pharetra, felis ut tristique adipiscing, diam magna rhoncus neque, sit amet convallis nibh nibh vel libero. Nulla facilisi. In eleifend nisl quis lorem. Duis semper fringilla justo. Proin imperdiet sapien sed lectus. Integer quis nisl et est elementum tempor. Morbi quis tellus nec turpis suscipit molestie. Praesent sed pede. Pellentesque ac orci. Sed sit amet urna eget tellus hendrerit aliquet. Nulla consectetur, pede aliquam ornare placerat, nunc augue commodo leo, sit amet elementum dolor est eleifend magna.
</p>
</div>
@tinogomes
tinogomes / magic-cards.txt
Created July 5, 2010 17:51
lista de cartas disponíveis e script para pegar os preços no Universo Parelelo
1,Grixis Panorama,Land
1,Naya Panorama,Land
1,Bant Panorama,Land
1,Obelisk of Esper,3
1,Obelisk of Bant,3
1,Lush Growth,G
1,Elvish Visionary,1G
1,Elvish Visionary,1G
1,Cylian Elf,1G
1,Savage Hunger,2G
@tinogomes
tinogomes / geolocation.rb
Created July 15, 2010 20:02
Geolocation
#--
# Copyright (c) 2006 Andrew Turner <geolocation@highearthorbit.com>
#
# Based on Geocoder - Copyright (c) 2006 Paul Smith <paul@cnt.org>
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
$ whois ericfer.com
Whois Server Version 2.0
Domain names in the .com and .net domains can now be registered
with many different competing registrars. Go to http://www.internic.net
for detailed information.
Domain Name: ERICFER.COM
Registrar: ENOM, INC.
@tinogomes
tinogomes / gist:669908
Created November 9, 2010 22:03
"autospec"
#!/usr/bin/env bash
while true; do
./script/spec $*
if [ "$?" == "130" ]; then
break
fi
echo ""
date
echo ""
@tinogomes
tinogomes / Ruby Annotation for TextMate Language
Created November 24, 2010 21:47
Add this on Ruby language
{ name = 'keyword.other.annotation.ruby';
comment = ' everything being a method but having a special function is a..';
match = '^\s*\b(private|public|protected)\b.*?$\n';
},
@tinogomes
tinogomes / gist:749885
Created December 21, 2010 12:37
To downcase all keys and subkeys from a hash
class Hash
def downcase_all_keys
result = self.map do |k,v|
[
k.downcase,
case v.class.name
when "Hash" then v.downcase_all_keys
when "Array" then v.map {|i| i.downcase_all_keys }
else v
end
module Authentication
def logged_in?
current_user.is_a?(User)
end
def current_user
@current_user ||= User.find_by_id(session[:user_id]) || :false
end
def current_user=(new_user)
@tinogomes
tinogomes / gist:770212
Created January 7, 2011 22:17
attr_* more fast than defined method
require "benchmark"
CYCLES = 1_000_000
class SomeModel
attr_accessor :attr_names
def method_name
@method_name
end
@tinogomes
tinogomes / gist:771704
Created January 9, 2011 13:56
Backing Up Your Wii Game Overview with MAC OS X
Extracted from http://chris-fletcher.com/2009/05/17/backup-and-burn-wii-games-on-a-mac/
1. Insert the Wii Game disc into your DVD drive.
2. Click Ignore
3. Open Terminal ( Applications -> Utilities -> Terminal
4. Type drutil status ( Get the Name i.e. /dev/disk1 )
5. Type dd if=/path_to_dvd of=/game_name.iso and wait 15 min
6. Type drutil eject to eject your game.
To copy