Skip to content

Instantly share code, notes, and snippets.

José Valim josevalim

Block or report user

Report or block josevalim

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
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 / 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 / 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:
# 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.