http://guides.rubyonrails.org/migrations.html
- add_column
- add_index
- change_column
- change_table
- create_table
- drop_table
| #!/bin/sh -e | |
| # | |
| # Usage: browser | |
| # pipe html to a browser | |
| # e.g. | |
| # $ echo '<h1>hi mom!</h1>' | browser | |
| # $ ron -5 man/rip.5.ron | browser | |
| if [ -t 0 ]; then | |
| if [ -n "$1" ]; then |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>Colors</key> | |
| <dict> | |
| <key>Background</key> | |
| <string>0.044 0.063 0.129</string> | |
| <key>InsertionPoint</key> | |
| <string>1.000 1.000 1.000</string> |
| require 'psych' | |
| list = ('a'..'z').to_a | |
| # Create a YAML AST | |
| viz = Psych::Visitors::YAMLTree.new {} | |
| viz << list | |
| tree = viz.tree | |
| # Change the Sequence node to be FLOW style |
http://guides.rubyonrails.org/migrations.html
| class Person | |
| def initialize(attributes) | |
| attributes.each do |attribute_name, attribute_value| | |
| ##### Method one ##### | |
| # Works just great, but uses something scary like eval | |
| # self.class.class_eval {attr_accessor attribute_name} | |
| # self.instance_variable_set("@#{attribute_name}", attribute_value) | |
| ##### Method two ##### | |
| # Manually creates methods for both getter and setter and then |
| require 'rails_helper' | |
| RSpec.describe TodosController, :type => :controller do | |
| describe "GET #index" do | |
| #describe "POST #create" do | |
| #describe "GET #show" do | |
| #describe "PATCH #update" do (or PUT #update) | |
| #describe "DELETE #destroy" do | |
| #describe "GET #new" do |
| db:create creates the database for the current env | |
| db:create:all creates the databases for all envs | |
| db:drop drops the database for the current env | |
| db:drop:all drops the databases for all envs | |
| db:migrate runs migrations for the current env that have not run yet | |
| db:migrate:up runs one specific migration | |
| db:migrate:down rolls back one specific migration | |
| db:migrate:status shows current migration status | |
| db:rollback rolls back the last migration | |
| db:forward advances the current schema version to the next one |
No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.
Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.
| #!/bin/bash | |
| # Locate the history file in your profile, and copy it to the same folder as this script. | |
| # On Mac: ~/Library/Application\ Support/Google/Chrome/Default/History | |
| # On Windows: C:\Users\YOUR USER NAME\AppData\Local\Google\Chrome\User Data\Default\History | |
| sqlite3 History <<! | |
| .headers on | |
| .mode csv | |
| .output out.csv |