Skip to content

Instantly share code, notes, and snippets.

Commandline output

$ ruby treetoar.rb 
SELECT "topics".* FROM "topics"  WHERE "topics"."id" = 1
Topic.where(id: 1)
SELECT "topics".* FROM "topics"  WHERE "topics"."id" IN (1, 2, 3)
Topic.where(id: [1, 2, 3])
@ryin
ryin / tmux_local_install.sh
Last active April 23, 2024 01:06
bash script for installing tmux without root access
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=1.8
class ActionDispatch::Routing::Mapper
def draw(routes_name)
instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb")))
end
end
BCX::Application.routes.draw do
draw :api
draw :account
draw :session