Skip to content

Instantly share code, notes, and snippets.

winston / jd-jgc-marketing.txt
Last active December 23, 2016 06:04
Marketing and Events Intern
View jd-jgc-marketing.txt
Jolly Good Code is a boutique software consultancy that specialises in
Agile software engineering practices and Ruby/Ruby on Rails.
Founded in 2014, Jolly Good Code is a nimble practice that can help startups
build the right product right, with high code quality and speed.
At the same time time, Jolly Good Code also provides Agile consulting services
and Ruby/Ruby on Rails training as public or corporate workshops.
Jolly Good Code is also supporting RedDotRubyConf - an annual Ruby conference

Image Upload Part 2

In part 1, we learned how to set up a simple image upload using Carrierwave and Cloudinary.

Although we are able to upload an image, but it lacks image manipulation functionalities, i.e. cropping.

Let's improve our image upload to allow for cropping!

Usually, this involves JavaScript and fortunately, Cloudinary has a JavaScript library which we could use!

winston /
Last active March 4, 2016 14:11
User Authentication

User Authentication

User Authentication is an important part of most web applications.

There are gems that can provide awesome authentication functionality out of the box, like Devise and Clearance.

However, it's also a good exercise in learning to implement our own authentication and understand the concepts for building out such a functionality.

winston /
Last active March 4, 2016 11:52
Rails Recipes

Country Select

Currently, we see a text field for country_code when creating a gram.

Let's replace that with a select dropdown with actual country names.

1. Install Gem

Add to your Gemfile, and run bundle install in your terminal after that.

winston / Procfile
Created November 20, 2015 04:14
Heroku + Rails + Sidekiq 4.0 Config
View Procfile
web: bundle exec puma -C config/puma.rb -p $PORT
worker: bundle exec sidekiq -e $RAILS_ENV -q default -q mailers
# By default, sidekiq only operates on the `default` queue
# So if you do ``, those are queued to the `mailers` queue
# Hence you need to explicitly tell Sidekiq to operate on `mailers` queue too
# You can also put this into sidekiq.yml
winston / Gemfile
Last active September 28, 2015 15:10
For enabling SQLite3 in Rails
View Gemfile
gem "sqlite3"
winston / gist:c82124ae560e57f7f865
Created March 25, 2015 09:42
From Local to Heroku
View gist:c82124ae560e57f7f865
# Dump locally
pg_dump DATABASE --no-owner --no-acl -f db.sql
# Reset Heroku
staging pg:reset
# Import to Heroku
staging pg:psql < db.sql
winston / T-Shirt
Last active June 3, 2021 14:20
RDRC T-Shirt Sizing
View T-Shirt

What is your T-shirt size?

Get your Half Chest size:

  • Get one of your T-shirts and lay it flat on a table.
  • Measure the distance (in cm) across the chest from side to side immediately below the armpit.

Tadaaa! That's your Half Chest measurement.

  • Men's XS (Half Chest: 47cm, Length 67cm)
winston / controller.rb
Created July 30, 2012 16:16
GoogleVisualr Gem - Bubble Chart Creation Example
View controller.rb
def bubble_chart
data_table =
data_table.new_column('string', 'ID')
data_table.new_column('number', 'Life Expectancy')
data_table.new_column('number', 'Fertility Rate')
data_table.new_column('string', 'Region')
data_table.new_column('number', 'Population')
data_table.add_rows( [