Skip to content

Instantly share code, notes, and snippets.

Felipe De Boni felipedeboni

  • Hello Innovation
  • Porto Alegre
Block or report user

Report or block felipedeboni

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@felipedeboni
felipedeboni / CEP.sql
Created Aug 13, 2013
Import data from GPBE tables (format as .csv, with ; as delimiter and quotes with ")
View CEP.sql
/* ===============================================================================================================================
This will get data from GBPE (previously) converted to CSV and:
* Create temporary tables
* Import data from: LOG_LOGRADOURO.csv, LOG_LOCALIDADE.csv, LOG_BAIRRO.csv into the temp tables
* Decrypt CEP column and create a new table with the following fields: cep, logradouro, bairro, cidade, uf, uf_sigla
* Dropping the temp shit
* Update PG Query Builder with an EXPLAIN ANALYZE
This script can be used to update an existing table (with same struct of course)
@felipedeboni
felipedeboni / gist:5746056
Created Jun 10, 2013
Fixing Certificate Verify Failed Rubygems
View gist:5746056
Download certificates from here: http://curl.haxx.se/ca/cacert.pem
Set this environment var on windows: SSL_CERT_FILE = path_to_cacert.pem
Close any opened cmd, open again and try bundle install, it should work now :)
otherwise you can try setting the repo of rubygems to use http instead https
@felipedeboni
felipedeboni / gist:5045193
Created Feb 27, 2013
Monkey Patch to_input_field_tag to translate html5 input placeholder if :placeholder => true in options
View gist:5045193
# monkey patch to translate placeholder if true is passed
# until something better appear in rails core
module ActionView::Helpers
class InstanceTag
def to_input_field_tag(field_type, options = {})
options = options.stringify_keys
options["size"] = options["maxlength"] || DEFAULT_FIELD_OPTIONS["size"] unless options.key?("size")
options = DEFAULT_FIELD_OPTIONS.merge(options)
if field_type == "hidden"
@felipedeboni
felipedeboni / code.js
Created Oct 23, 2012
scroll to top of right col
View code.js
$( 'html, body' )
.stop( true, true )
.animate({
scrollTop: $( '#wms-content .right-col' ).offset().top - 20
}, 500);
@felipedeboni
felipedeboni / code.js
Created Oct 23, 2012
add class to body
View code.js
(function($) {
hyphenate = function( preffix, str ) {
str = str.replace( /[A-Z]/g , function( match ){
return ( '-' + match.charAt( 0 ).toLowerCase() );
});
return preffix + '-' + str.replace( / /g , '' ).replace( /^-/, '' ).replace( /-{2,}/g , '-' )
}
@felipedeboni
felipedeboni / jQuery Placeholder
Created Oct 9, 2012
Javascript: jquery.placeholder.js
View jQuery Placeholder
/**
* jQuery Watermark Plugin
*
* @author Felipe K. De Boni
*
* Dependencies:
* Mootools Server (to use decent class creation method)
*/
(function($, undefined) {
View gist:2048019
class ActionDispatch::Session::AbstractStore
def call(env)
# the only place I could find that knows how to mutate out the :all was the CookieJar, so we use that before Rack gets an invalid :domain
@default_options[:domain] = :all
ActionDispatch::Request.new(env).cookie_jar.handle_options(@default_options)
super
end
end
View gist:2014163
Go eXtreme Horse (XGH)
1 - thought, is not XGH.
XGH not think, is the first thing that comes to mind. There is no second option, the only option is the fastest.
2 - There are three ways to solve a problem, correct the wrong and XGH, which is equal to the wrong, only faster.
XGH is faster than any software development methodology you know (see Axiom 14).
You can’t perform that action at this time.