Skip to content

Instantly share code, notes, and snippets.

Antoine Lizee antoine-lizee

Block or report user

Report or block antoine-lizee

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
skranz / s_dplyr
Created Mar 21, 2014
Wrappers to dplyr's data modification functions like arrange, select,... that work with string arguments.
View s_dplyr
# Helper functions that allow string arguments for dplyr's data modification functions like arrange, select etc.
# Author: Sebastian Kranz
# Examples are below
#' Modified version of dplyr's filter that uses string arguments
#' @export
s_filter = function(.data, ...) {
eval.string.dplyr(.data,"filter", ...)
hest / gist:8798884
Created Feb 4, 2014
Fast SQLAlchemy counting (avoid query.count() subquery)
View gist:8798884
def get_count(q):
count_q = q.statement.with_only_columns([func.count()]).order_by(None)
count = q.session.execute(count_q).scalar()
return count
q = session.query(TestModel).filter(...).order_by(...)
# Slow: SELECT COUNT(*) FROM (SELECT ... FROM TestModel WHERE ...) ...
print q.count()
ssimeonov / memory_snapshot.rb
Created Jul 18, 2013
Analyze dyno memory use on Heroku with this memory footprint analyzer.
View memory_snapshot.rb
# Memory snapshot analyzer which parses the /proc file system on *nix
# Example (run in Heroku console):
# ms =
# 1.upto(10000).map { |i| }; nil
# ms.snapshot!; nil
# ms.diff 10
# => {"lib/"=>156, "heap"=>2068, "all"=>2224}
bjhess / st_cheat.txt
Created Jan 11, 2012
Sublime Text Cheatsheet
View st_cheat.txt
cmd-p Goto Anything ('@' for functions, ':' for line number)
cmd-r Function finder
ctl-g Goto line number
cmd-sft-p Command palette
cmd-sft-f Find in Files
cmd-opt-r Toggle regex when finding
cmd-opt-# Columns
ctr-# Switch columns
clintel / gist:1155906
Created Aug 19, 2011
Fenced code in bullet lists with GitHub-flavoured MarkDown??
View gist:1155906

Fenced code blocks inside ordered and unordered lists

  1. This is a numbered list.

  2. I'm going to include a fenced code block as part of this bullet:

    More Code
You can’t perform that action at this time.