Skip to content

Instantly share code, notes, and snippets.

@josevalim
josevalim / 0_README.md
Created September 13, 2012 21:52
Sinatra like routes in Rails controllers

Sinatra like routes in Rails controllers

A proof of concept of having Sinatra like routes inside your controllers.

How to use

Since the router is gone, feel free to remove config/routes.rb. Then add the file below to lib/action_controller/inline_routes.rb inside your app.

@solnic
solnic / fun.rb
Last active December 26, 2015 23:29
Ruby object that has "functions" rather than methods
class Function
attr_reader :name, :fn
class Composed
attr_reader :left, :right
def initialize(left, right)
@left = left
@right = right
end
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active April 1, 2026 23:39
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@ibraheem4
ibraheem4 / postgres-brew.md
Last active March 23, 2026 03:33
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update

Complete Specification: Zap — Typed Functional Elixir-Syntax Language Lowering to Zig

1. Purpose

This language is a new statically typed, functional, macro-capable language with Elixir-like syntax and a native backend strategy built around lowering through a Zig-oriented compiler pipeline.

It is:

  • Elixir-shaped at the surface
  • statically typed