Skip to content

Instantly share code, notes, and snippets.

@VictorTpo
Last active January 20, 2016 13:13
Show Gist options
  • Save VictorTpo/bd77517b0669a69f878f to your computer and use it in GitHub Desktop.
Save VictorTpo/bd77517b0669a69f878f to your computer and use it in GitHub Desktop.
# link if
<%= link_to_if obj.method?, obj.show_blabla, url %>
# WRONG
class CleanSql
def initialize
@clent = Mysql2::Client.new
end
end
# > 10_000_000.times { CleanSql.new }
# > mysql too many connection
# GOOD
class CleanSql
CLIENT = Mysql2::Client.new
end
# > 10_000_000.times { CleanSql.new }
# > butter, money of butter and creamer butt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment