In your command-line run the following commands:
brew doctorbrew update
In your command-line run the following commands:
brew doctorbrew updateCTRL + A — Move to the beginning of the lineCTRL + E — Move to the end of the lineCTRL + [left arrow] — Move one word backward (on some systems this is ALT + B)CTRL + [right arrow] — Move one word forward (on some systems this is ALT + F)CTRL + U — (bash) Clear the characters on the line before the current cursor positionCTRL + U —(zsh) If you're using the zsh, this will clear the entire lineCTRL + K — Clear the characters on the line after the current cursor positionESC + [backspace] — Delete the word in front of the cursor| # Could be used for instance like this in Phoenix: <%= select f, :time_zone, SimpleTimeZoneList.mapping %> | |
| defmodule SimpleTimeZoneList do | |
| @mapping %{ | |
| "International Date Line West" => "Pacific/Midway", | |
| "Midway Island" => "Pacific/Midway", | |
| "American Samoa" => "Pacific/Pago_Pago", | |
| "Hawaii" => "Pacific/Honolulu", | |
| "Alaska" => "America/Juneau", | |
| "Pacific Time (US & Canada)" => "America/Los_Angeles", | |
| "Tijuana" => "America/Tijuana", |
| # | |
| # INSERT query generator for Oracle | |
| # | |
| # Requirements: | |
| # - Ruby 2.0 or later (https://www.ruby-lang.org/) | |
| # - ruby-oci8 (gem install ruby-oci8) | |
| # - Oracle Database | |
| # | |
| require 'oci8' |
Download and install PL/JSON.
Following is an example of how to parse a JSON array represented as string:
declare
my_clob clob := '[Magic words:
psql -U postgresSome interesting flags (to see all, use -h or --help depending on your psql version):
-E: will describe the underlaying queries of the \ commands (cool for learning!)-l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)| # Based on https://gist.github.com/fernandoaleman/5083680 | |
| # Start the old vagrant | |
| $ vagrant init ubuntu_saucy | |
| $ vagrant up | |
| # You should see a message like: | |
| # [default] The guest additions on this VM do not match the install version of | |
| # VirtualBox! This may cause things such as forwarded ports, shared | |
| # folders, and more to not work properly. If any of those things fail on |
Every programming community quickly converges on a style, an accepted set of idioms. Programming is all about communication and knowing those idioms are key to being a successful programmer in that community.
Ruby style of programming:
Ruby indentation convention:
| ################################################################################ | |
| require 'oci8' | |
| require 'iconv' | |
| ################################################################################ | |
| class OracleReader | |
| ################################################################################ | |
| def initialize(server, username, password) | |
| # Open the connection. | |
| @connection = OCI8.new(username, password, server) |