Skip to content

Instantly share code, notes, and snippets.

Dave Paola dpaola2

Block or report user

Report or block dpaola2

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 Makefile
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@krasnoukhov
krasnoukhov / 2013-01-07-profiling-memory-leaky-sidekiq-applications-with-ruby-2.1.md
Last active Jun 11, 2019
Profiling memory leaky Sidekiq applications with Ruby 2.1
View 2013-01-07-profiling-memory-leaky-sidekiq-applications-with-ruby-2.1.md

My largest Sidekiq application had a memory leak and I was able to find and fix it in just few hours spent on analyzing Ruby's heap. In this post I'll show my profiling setup.

As you might know Ruby 2.1 introduced a few great changes to ObjectSpace, so now it's much easier to find a line of code that is allocating too many objects. Here is great post explaining how it's working.

I was too lazy to set up some seeding and run it locally, so I checked that test suite passes when profiling is enabled and pushed debugging to production. Production environment also suited me better since my jobs data can't be fully random generated.

So, in order to profile your worker, add this to your Sidekiq configuration:

if ENV["PROFILE"]
View richhickey.md

Rich Hickey on becoming a better developer

Rich Hickey • 3 years ago

Sorry, I have to disagree with the entire premise here.

A wide variety of experiences might lead to well-roundedness, but not to greatness, nor even goodness. By constantly switching from one thing to another you are always reaching above your comfort zone, yes, but doing so by resetting your skill and knowledge level to zero.

Mastery comes from a combination of at least several of the following:

anonymous
anonymous / gist:1772756
Created Feb 8, 2012
four chapters
View gist:1772756
Clone URL: https://github.com/hanibash/Course-One
Tests for Chapter 1: rspec spec -e step1 --require ./spec/json_formatter.rb --format JSONFormatter
Tests for Chapter 2: rspec spec -e step2 --require ./spec/json_formatter.rb --format JSONFormatter
Tests for Chapter 3: rspec spec -e step3 --require ./spec/json_formatter.rb --format JSONFormatter
Tests for Chapter 4: rspec spec -e step4 --require ./spec/json_formatter.rb --format JSONFormatter
etc...
### First Steps
@jamescasbon
jamescasbon / template.py
Created Dec 11, 2011
Pure python templates using with statement
View template.py
"""
A really stupid python template language inspired by coffeekup, markaby.
Do not use this code, it will ruin your day. A byproduct of insomnia.
TL;DR
-----
This module defines a template language that allows us to do:
d = Doc()
anonymous
anonymous / bootstrap.sh
Created Jun 2, 2011
Django on Heroku with Celery and Sentry
View bootstrap.sh
virtualenv --no-site-packages .
source bin/activate
bin/pip install Django psycopg2 django-sentry
bin/pip freeze > requirements.txt
bin/django-admin.py startproject mysite
cat >.gitignore <<EOF
bin/
include/
lib/
EOF
View capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
You can’t perform that action at this time.