Skip to content

Instantly share code, notes, and snippets.

View shved's full-sized avatar
🦀

Vitalii Shvedchenko shved

🦀
View GitHub Profile
@ProGM
ProGM / arel_cheatsheet_on_steroids.md
Last active June 14, 2024 02:40
Arel cheatsheet on Steroids

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

@kandros
kandros / elixir_timer_interval.exs
Created July 31, 2016 17:13
Set an interval in elixir-lang using erlang timer module
:timer.apply_interval(1000, IO, :puts, ["weeeee"]) # millisends, module, function as atom, list of arguments
@romainl
romainl / deprecation.md
Last active February 24, 2022 02:42
Idiomatic vimrc
@erichurst
erichurst / US Zip Codes from 2013 Government Data
Created December 9, 2013 23:00
All US zip codes with their corresponding latitude and longitude coordinates. Comma delimited for your database goodness. Source: http://www.census.gov/geo/maps-data/data/gazetteer.html
This file has been truncated, but you can view the full file.
ZIP,LAT,LNG
00601,18.180555, -66.749961
00602,18.361945, -67.175597
00603,18.455183, -67.119887
00606,18.158345, -66.932911
00610,18.295366, -67.125135
00612,18.402253, -66.711397
00616,18.420412, -66.671979
00617,18.445147, -66.559696
00622,17.991245, -67.153993
@rstacruz
rstacruz / index.md
Last active November 3, 2023 09:56
Rails models cheatsheet

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one