start new:
tmux
start new with session name:
tmux new -s myname
# Replace TABLE and COLUMN as appropriate | |
Update TABLE Set COLUMN = Replace(COLUMN, CHAR(3), ''); |
# RSpec matcher to spec delegations. | |
# Forked from https://gist.github.com/ssimeonov/5942729 with fixes | |
# for arity + custom prefix. | |
# | |
# Usage: | |
# | |
# describe Post do | |
# it { should delegate(:name).to(:author).with_prefix } # post.author_name | |
# it { should delegate(:name).to(:author).with_prefix(:any) } # post.any_name | |
# it { should delegate(:month).to(:created_at) } |
I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.
These are the steps I went through to set up an SSL cert.
This brief guide is written from my own experience with migrating a large (~5GB) MySQL database to PostgreSQL for a Rails project.
No warranties, guarantees, support etc. Use at your own risk and, as always, ENSURE YOU MAKE BACKUPS FIRST!
I chose [pgloader
][1] because it's extremely fast. YMMV.
mysql2
gem with pg
in Gemfile
.config/database.yml
for PostgreSQL. I used [Rails' template][2] as a starting point.<!-- | |
In the template just use the @view object and call it's methods to clean up | |
the presentation logic. Maybe think about adding a helper method called `view` | |
that just returns `@view` so we can remove the noise of the `@`. | |
--> | |
<%= @view.users.each do |user| %> | |
<%= @view.user_link(user) %> | |
<% end %> |
-- See https://github.com/dimitri/pgloader/blob/master/pgloader.1.md for | |
-- connection string options. | |
LOAD DATABASE | |
FROM mysql://root@localhost/mydb | |
INTO postgresql:///mydb | |
WITH include drop, truncate, create tables, create indexes, foreign keys, reset sequences | |
-- CAST varchar to varchar instead of text |
(cors) { | |
@cors_preflight{args.0} method OPTIONS | |
@cors{args.0} header Origin {args.0} | |
handle @cors_preflight{args.0} { | |
header { | |
Access-Control-Allow-Origin "{args.0}" | |
Access-Control-Allow-Methods "GET, POST, PUT, PATCH, DELETE, OPTIONS" | |
Access-Control-Allow-Headers * | |
Access-Control-Max-Age "3600" |