Skip to content

Instantly share code, notes, and snippets.

View daya's full-sized avatar

Daya Sharma daya

View GitHub Profile
@dominicletz
dominicletz / find_fragmentation.erl
Created June 2, 2020 16:21
Erlang script to show used vs. allocated carrier sizes to find impact of memory fragmentation
f().
Str = fun(X) -> io_lib:format("~p", [X]) end.
Percent = fun
(A, 0) -> "100%";
(A, B) -> [Str(round(100*A/B)), "%"]
end.
Get = fun
@erdostom
erdostom / Dockerfile
Last active November 25, 2022 14:53
Good starter Dockerfile + docker-compose.yml for Rails 6.
FROM ruby:2.6.5-alpine
RUN apk add --update --no-cache bash build-base nodejs sqlite-dev tzdata postgresql-dev yarn
RUN gem install bundler:2.1.4
WORKDIR /usr/src/app
COPY package.json yarn.lock ./
RUN yarn install --check-files
@nick-jonas
nick-jonas / bubbles-canvas.js
Last active October 24, 2016 02:55
Animating bubbles using Canvas
// called once, to initialize
createBubbles: function(){
var self = this,
el = this.element,
width = $(window).width(),
height = $(window).height(),
canvas = document.createElement('canvas');
el.style.width = canvas.width = width;
el.style.height = canvas.height = height;
@wallace
wallace / Debugging Ruby Notes.html
Created November 9, 2010 20:23
My notes from Aman Gupta's Debugging Ruby webinar by Engine Yard
<a href="http://en.wikipedia.org/wiki/Lsof">lsof</a>
----
show open files
lsof -nPp <pid>
<a href="http://linux.die.net/man/1/strace">strace</a>
------