Skip to content

Instantly share code, notes, and snippets.

View saurabhnanda's full-sized avatar

Saurabh Nanda saurabhnanda

View GitHub Profile
@qlyoung
qlyoung / challenges-with-running-cpu-pinned-processes-within-docker.md
Last active October 16, 2020 09:44
Some notes on issues faced when using CPU pinning within a docker container

Challenges with running CPU pinned processes within Docker

Programs that want to bind themselves to free cores present some challenges
when run within Docker.

CPU pinning allows a program to request it be assigned exclusively to a core or set of cores This improves cache locality and other factors that become relevant for extremely CPU bound processes, especially in combination with other configurations that prevent the scheduler from assigning other processes

@alassek
alassek / 01_Annotated_Source.md
Last active November 19, 2023 11:53
Extending Arel to support @> operator

I've been doing some work lately with JSON documents in PostgreSQL using jsonb columns. You can query these documents using a GIN index in PG, but the syntax can be a little cumbersome

SELECT "events".* FROM "events" WHERE "events"."body" @> '{"shift":{"user_id":2}}'

You have to construct the right side of the query as a JSON string, which is a bit annoying. So I wondered if I could adapt Arel to do the tedious stuff for me.

@killercup
killercup / pandoc.css
Created July 3, 2013 11:31
Add this to your Pandoc HTML documents using `--css pandoc.css` to make them look more awesome. (Tested with Markdown and LaTeX.)
/*
* I add this to html files generated with pandoc.
*/
html {
font-size: 100%;
overflow-y: scroll;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
@amitchhajer
amitchhajer / Count Code lines
Created January 5, 2013 11:08
Count number of code lines in git repository per user
git ls-files -z | xargs -0n1 git blame -w | perl -n -e '/^.*\((.*?)\s*[\d]{4}/; print $1,"\n"' | sort -f | uniq -c | sort -n