TL;DR
Install Postgres 10, and then:
sudo pg_dropcluster 10 main --stop
sudo pg_upgradecluster 9.6 main
sudo pg_dropcluster 9.6 main
class Dollar | |
attr_reader :cents | |
def initialize(cents:) | |
@cents = cents | |
end | |
def hash | |
[self.class, cents].hash | |
end |
TL;DR
Install Postgres 10, and then:
sudo pg_dropcluster 10 main --stop
sudo pg_upgradecluster 9.6 main
sudo pg_dropcluster 9.6 main
This is a compiled list of falsehoods programmers tend to believe about working with time.
Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.
To use the most modern version of Postgres software we need to add postgresql repository. Edit /etc/apt/sources.list
or create /etc/apt/sources.list.d/pgdg.list
and add there a line: deb http://apt.postgresql.org/pub/repos/apt/ jessie-pgdg main
Then import the repository signing key, and update the package lists:
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
Install a new version of PostgreSQL server.
Once the Debian upgrade finished, I used dpkg-query -l postgresql*
to check which versions of postgres I have installed.
require 'google/apis/analyticsreporting_v4' | |
require 'googleauth' | |
include Google::Apis::AnalyticsreportingV4 | |
include Google::Auth | |
VIEW_ID = "12345678" #your profile ID from your Analytics Profile | |
SCOPE = 'https://www.googleapis.com/auth/analytics.readonly' | |
@client = AnalyticsReportingService.new |
TL;DR
Install Postgres 9.6, and then:
sudo pg_dropcluster 9.6 main --stop
sudo pg_upgradecluster 9.5 main
sudo pg_dropcluster 9.5 main
require 'graphql' | |
require 'neo4j' | |
neo4j_url = ENV['NEO4J_URL'] || 'http://localhost:7474' | |
session = Neo4j::Session.open(:server_db, neo4j_url) | |
class Author | |
include Neo4j::ActiveNode | |
id_property :id_author |
@startuml | |
' uncomment the line below if you're using computer with a retina display | |
' skinparam dpi 300 | |
!define Table(name,desc) class name as "desc" << (T,#FFAAAA) >> | |
' we use bold for primary key | |
' green color for unique | |
' and underscore for not_null | |
!define primary_key(x) <b>x</b> | |
!define unique(x) <color:green>x</color> | |
!define not_null(x) <u>x</u> |
# lib/tasks/db.rake | |
namespace :db do | |
desc "Dumps the database to db/APP_NAME.dump" | |
task :dump => :environment do | |
cmd = nil | |
with_config do |app, host, db, user| | |
cmd = "pg_dump --host #{host} --username #{user} --verbose --clean --no-owner --no-acl --format=c #{db} > #{Rails.root}/db/#{app}.dump" | |
end | |
puts cmd |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.