Skip to content

Instantly share code, notes, and snippets.

Avatar

José Valim josevalim

View GitHub Profile
View gist:3a2e355354e7f19066a0
## Enable kernel poll and a few async threads
+K true
+A 5
+Q 64000
+P 128000
+sbt db
+sbwt very_long
+swt very_low
+sub true
+Mulmbcs 32767
@nox
nox / prealloc_bin.S
Created Apr 10, 2013
Preallocated binaries in Erlang... well, in BEAM.
View prealloc_bin.S
{module, prealloc_bin}. %% version = 0
{exports, [{module_info,0},{module_info,1},{new,1}]}.
{attributes, []}.
{labels, 7}.
{function, new, 1, 2}.
@raggi
raggi / escape_like.rb
Created Sep 27, 2011
YOU WON'T (escape likes)
View escape_like.rb
module EscapeLike
# Escape SQL LIKE arguments. N.B. This should be combined with use of the
# ESCAPE parameter also. See:
# http://dev.mysql.com/doc/refman/5.0/en/string-comparison-functions.html
#
# pattern = escape_like(params[:pattern]) << '%'
# query = where(["name LIKE ? ESCAPE ?", pattern, '\\'])
#
# By default this method uses MySQLs default escape, backslash.
# Unfortunately, this can get exceedingly confusing in output. As soon as
You can’t perform that action at this time.