Skip to content

Instantly share code, notes, and snippets.

View DNA's full-sized avatar

Leonardo Prado DNA

View GitHub Profile
@DNA
DNA / serializable_report.rb
Created April 19, 2021 21:00
Testing hash refinement on jsonapi-serializable
# frozen_string_literal: true
class SerializableReport < JSONAPI::Serializable::Resource
using Refinements::SerializableHash
id { @object['id'] }
attributes :foo, :bar
end
@DNA
DNA / sql_server.rb
Created October 28, 2021 20:01
Fix Rails SQL Server Adapter when using Arel::Nodes::TableAlias
# frozen_string_literal: true
module Arel
module Visitors
class SQLServer < Arel::Visitors::ToSql
def table_From_Statement o
core = o.cores.first
table_From_Node(core.from) || table_From_Node(core.source)
@DNA
DNA / cheatsheet.md
Created January 17, 2022 16:13
Personal annotations as I learn C#

C# Cheat Sheet

Strings

"Foo" // string
'F'   // Char

Interpolations