Skip to content

Instantly share code, notes, and snippets.

View Willianvdv's full-sized avatar
🚩

Willian van der Velde Willianvdv

🚩
View GitHub Profile
@mildmojo
mildmojo / left_join_arel_example.rb
Last active April 5, 2024 16:00
LEFT JOIN in ARel for ActiveRecord in Ruby on Rails
# Here's a contrived example of a LEFT JOIN using ARel. This is an example of
# the mechanics, not a real-world use case.
# NOTE: In the gist comments, @ozydingo linked their general-purpose ActiveRecord
# extension that works for any named association. That's what I really wanted!
# Go use that! Go: https://gist.github.com/ozydingo/70de96ad57ab69003446
# == DEFINITIONS
# - A Taxi is a car for hire. A taxi has_many :passengers.
# - A Passenger records one person riding in one taxi one time. It belongs_to :taxi.
@peterhellberg
peterhellberg / contributions.coffee
Last active August 29, 2015 13:58
Rendering public GitHub contributions using Lineman.js and Obelisk.js
window.drawContributions = (data) ->
s = 12
canvas = document.getElementById('contributions')
point = new obelisk.Point(200, 100)
pixelView = new obelisk.PixelView(canvas, point)
color = new obelisk.SideColor().getByInnerColor(0xFEFEFE)
color.border = 0x14000000