Skip to content

Instantly share code, notes, and snippets.

@mucaho
mucaho / arel_helpers.rb
Created April 19, 2025 11:23 — forked from hadees/arel_helpers.rb
Arel Helpers
module ArelHelpers
extend self
def self.included(base)
base.extend self
end
def asterisk(arel_table_or_model)
arel_table, columns = case arel_table_or_model
when Arel::Table
@mucaho
mucaho / arel_cheatsheet_on_steroids.md
Created April 19, 2025 11:22 — 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

@mucaho
mucaho / scopelist.txt
Created April 7, 2016 22:05 — forked from jasonm23/scopelist.txt
A list of Sublime Scopes scraped from all themes listed by Aziz' tmTheme Editor
active_guide
argument-name
block_cursor
brackethighlighter.curly
brackethighlighter.tag
class
class-inheritance
class-name
comment
comment.block
@mucaho
mucaho / Makefile
Last active August 29, 2015 14:27 — forked from bellbind/Makefile
[iojs][emscripten] Call sudoku solver function implemented in C on iojs
all: libsudoku.js sudoku.js sudoku
clean:
rm -f libsudoku.js sudoku.js sudoku
rm -f libsudoku.js.map sudoku.js.map
rm -f libsudoku.js.mem sudoku.js.mem
# library for using functions in hand written JavaScript code
libsudoku.js: libsudoku.c
emcc -g4 -Wall -Wextra -std=c11 $^ -o $@ \
-s EXPORTED_FUNCTIONS="['_output', '_sudoku']" \