Skip to content

Instantly share code, notes, and snippets.

View delameko's full-sized avatar

Matt Slater delameko

View GitHub Profile
@mdesantis
mdesantis / upgrade-postgres-9.6-to-10.md
Last active October 11, 2021 08:11 — forked from delameko/upgrade-postgres-9.5-to-9.6.md
Upgrading PostgreSQL from 9.6 to 10 on Ubuntu 16.04

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
@laserlemon
laserlemon / introduction.md
Last active February 12, 2021 10:04
Rendering form errors for non-database-backed changesets

Introduction

Disclaimer: I'm a one-day-old Elixir/Phoenix developer.

In Sonny's training yesterday, we used an Ecto.Changeset to handle user registration (a database-backed operation). This worked perfectly for rendering the intial form and re-rendering the form with validation errors.

This is because our Workshop.RegistrationController is calling Repo.Insert which sets the changeset's :action, whether or not the insertion succeeds. Then Phoenix.HTML's form_for function appropriately sets errors on the form so they can be rendered on the page.

The Problem

@delameko
delameko / RailsHTTPStatusCodes.md
Last active September 19, 2015 11:02
Rails HTTP status codes/symbol names

###1xx Informational

code message symbol
100 Continue :continue
101 Switching Protocols :switching_protocols
102 Processing :processing

###2xx Success

@robpataki
robpataki / xld_filename.md
Last active August 25, 2023 11:38
File naming convention for XLD encoding

Compilations:

%A - %T  -  %n - %a - %t

Albums by 1 artist

%A - %T  -  %n - %t
@johnpolacek
johnpolacek / gist:3827270
Last active January 20, 2023 15:46
Prevent FOUC
<!-- Prevent FOUC (flash of unstyled content) - http://johnpolacek.com/2012/10/03/help-prevent-fouc/ -->
<style type="text/css">
.no-fouc {display: none;}
</style>
<script type="text/javascript">
document.documentElement.className = 'no-fouc';
// add to document ready: $('.no-fouc').removeClass('no-fouc');
</script>