Skip to content

Instantly share code, notes, and snippets.

View jacksonpires's full-sized avatar
🏠
Working from home

Jackson Pires jacksonpires

🏠
Working from home
View GitHub Profile

Arel Cheatsheet on Steroids

A (more) complete cheatsheet for Arel, including NamedFunction functions, raw SQL and window functions.

Tables

posts = Arel::Table.new(:posts)
posts = Post.arel_table # ActiveRecord

Table alias

@jacksonpires
jacksonpires / must-watch-talks.txt
Created December 23, 2022 23:17 — forked from lastk/must-watch-talks.txt
must-watch talks
Rich Hickey
https://confreaks.tv/videos/railsconf2012-keynote-simplicity-matters
https://confreaks.tv/videos/jaxconf2012-keynote-the-value-of-values
Dave Thomas
https://confreaks.tv/videos/elixirconf2014-opening-keynote-think-different
https://confreaks.tv/videos/lonestarruby2013-elixir-power-of-erlang-joy-of-ruby
Robert Martin
https://confreaks.tv/videos/rubymidwest2011-keynote-architecture-the-lost-years
@jacksonpires
jacksonpires / remove-submodule.sh
Created February 11, 2021 22:08 — forked from niartenyaw/remove-submodule.sh
App Academy - Remove unwanted submodule from nested Git repos and re-add all the files inside of it
# In most cases, a single Rails app will be attached to a single repo
# As of Rails 5.1, initializing a new project will also automatically initialize Git
# This is perfect in most circumstances, but at App Academy, students have homework and
# project repos that contain multiple rails apps inside them
# To account for this without pushing the submodules, students need to remove the .git
# directory before adding and commiting the new project, but most do not, resulting in
@jacksonpires
jacksonpires / custom_arel.rb
Created July 8, 2020 18:57 — forked from gabeodess/custom_arel.rb
An example of how to add a custom predicate to Arel
module Arel::Predications
def has_key(right)
Arel::Nodes::HasKey.new(self, quoted_node(right))
end
end
class Arel::Nodes::HasKey < Arel::Nodes::Binary
def operator; :"?" end
end
@jacksonpires
jacksonpires / arel_any_predicate.rb
Created July 8, 2020 18:54 — forked from 3014zhangshuo/arel_any_predicate.rb
An example of how to add a custom predicate to Arel
module Arel::Predications
def any(right)
Arel::Nodes::Any.new(self, quoted_node(right))
end
end
class Arel::Nodes::Any < Arel::Nodes::Binary
def operator
:'ANY'
end
@jacksonpires
jacksonpires / gist:791050a86e5cc7f5295d7bcc1a4bba87
Created February 26, 2020 15:54 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@jacksonpires
jacksonpires / pull_request.md
Last active March 28, 2020 21:20 — forked from anchietajunior/pull_request.md
This is a PR template

Pull Request Description

This PR aims to do something (detailed description).

Type (Feature, Fix, Config, etc)

  • Bug fix 🐞
  • New feature ✨
  • Breaking change 🔩
  • This change requires a documentation update 📙