Skip to content

Instantly share code, notes, and snippets.

View FoboCasteR's full-sized avatar
🚀

Eugene Khutko FoboCasteR

🚀
View GitHub Profile
@FoboCasteR
FoboCasteR / arel_cheatsheet_on_steroids.md
Created January 17, 2025 11:37 — forked from ProGM/arel_cheatsheet_on_steroids.md
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

@FoboCasteR
FoboCasteR / PGRegion.cs
Created November 23, 2024 09:22 — forked from klightspeed/PGRegion.cs
Elite Dangerous procgen system parsing
using System;
using System.Collections.Generic;
[System.Diagnostics.DebuggerDisplay("{Name}: ({X0},{Y0},{Z0})")]
public class PGRegion
{
public string Name { get; set; }
public float X0 { get; set; }
public float Y0 { get; set; }
public float Z0 { get; set; }
@FoboCasteR
FoboCasteR / after_commit.rb
Created November 12, 2013 08:57
Test after_commit callback with RSpec + DatabaseCleaner
def after_commit_environment(strategy = :deletion, &block)
obj = self
begin
before(:all) do
obj.use_transactional_fixtures = false
DatabaseCleaner.strategy = strategy
end
before do