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
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
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
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 = MemorySnapshot.new
# 1.upto(10000).map { |i| Array.new(i) }; nil
# ms.snapshot!; nil
# ms.diff 10
# => {"lib/ld-2.11.1.so"=>156, "heap"=>2068, "all"=>2224}
#
@bjhess
bjhess / st_cheat.txt
Created Jan 11, 2012
Sublime Text Cheatsheet
View st_cheat.txt
Navigation:
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
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:

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