Skip to content

Instantly share code, notes, and snippets.

module CallChain
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
private
def define_function(name, function)
define_method(name) { function }
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" media="screen" href="https://fonts.googleapis.com/css?family=Questrial">
<style>
body {
font-family: Questrial, Arial, 'sans-serif'
}
.row {
find ./src -type f -exec sed -i '' -e 's/ApiClient/RestApiClient/' {} \;
select t.*, (select json_group_array(json_object('id', s.id, 'amount', s.amount))) from transactions t join transactions s on s.primary_transaction_id = t.id where t.id = 2;
find ./app/models -type f -exec sed -i '' -e "s/ActiveRecord\:\:Base/ApplicationRecord/g" {} \;
@rcmoret
rcmoret / vrc
Created September 15, 2016 22:26
Script for opening a rails console for an app within vagrant
#! /bin/bash
if [[ -z $1 ]]; then
APP_NAME=$(basename `pwd`)
else
APP_NAME=$1
fi
echo "Opening Rails Console for $APP_NAME in vagrant..."
cd ~/vagrant && vagrant ssh -c "cd /pub/$APP_NAME/current && bundle exec rails console"