Skip to content

Instantly share code, notes, and snippets.

@maxcobmara
maxcobmara / 01_denormalize_project_status.rb
Created August 4, 2016 03:52
Denormalise a status via Rails migration
class DenormalizeProjectStatus < ActiveRecord::Migration
def up
add_column :projects, :status, :string, limit: 32
execute %q(UPDATE projects p SET status = (SELECT name FROM statuses s WHERE s.id = p.status_id))
change_column :projects, :status, :string, null: false, limit: 32
remove_column :projects, :status_id
end
end
@maxcobmara
maxcobmara / bootstrap.sh
Last active June 13, 2017 08:03
REV Asia OSX Setup
#!/bin/sh
# init
function pause(){
read -p "$*"
}
# Updated for El-Capitan
echo "1. A Rails Services Admin Account"
echo - e "Create an account that you'll use to administer the Rails applications , PSQL and other stuff, \n
keep it seperate from your root account and your personal account."
@maxcobmara
maxcobmara / WSL2 Installation
Last active July 26, 2021 10:21
Installing Ubuntu on Windows 10 via WSL2
Install Windows Terminal
https://aka.ms/terminal
In Windows Powershell as Administrator (C:\>)
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
Restart Windows
Inn Windows Powershell as Administrator (C:\>)
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart