Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block cjlaborde

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View async await vs then

In real code, you would call makePromise().then() or await makePromise(). I assigned the promise to an intermediate variable to illustrate the difference. Which style do you prefer?

const cl = console.log

function thenCatch () {
    const promise = makePromise()
View Vue

Async calls

When isLoading is true, the <div> is in the DOM, the <p> is not.
When isLoading is false, Vue will remove the <div> and add the <p> to the DOM,
at which point <MyComponent> will be created and passed the fetched data.
<div v-if="isLoading">
rustprooflabs / srid_units.sql
Last active May 10, 2020
Creates view in PostGIS enabled database to make it easier to find what units each SRID is in.
View srid_units.sql
CREATE OR REPLACE VIEW public.srid_units AS
SELECT srid, CASE WHEN proj4text LIKE '%+units=%' THEN True
ELSE False
END AS units_set,
CASE WHEN proj4text LIKE '%+units=m%' THEN 'Meters'
WHEN proj4text LIKE '%+units=ft%' THEN 'Feet'
WHEN proj4text LIKE '%+units=us-ft%' THEN 'Feet'
WHEN proj4text LIKE '%+units=link%'
OR proj4text LIKE '%+units=%'
THEN 'Set, not caught properly'
james2doyle / NextValetDriver.php
Created Nov 17, 2018
A Laravel Valet driver for running generated Next.js sites. This driver assumes you have not changed the default public path (/out) in the next.config.js
View NextValetDriver.php
* NextValetDriver for running compiled next.js sites
class NextValetDriver extends BasicValetDriver
* Determine if the driver serves the request.
rosario /
Created Jan 17, 2018 — forked from Geoff-Ford/
Eric Elliott's Composing Software Series
yesvods / gist:51af798dd1e7058625f4
Created Aug 15, 2015
Merge Arrays in one with ES6 Array spread
View gist:51af798dd1e7058625f4
const arr1 = [1,2,3]
const arr2 = [4,5,6]
const arr3 = [...arr1, ...arr2] //arr3 ==> [1,2,3,4,5,6]
Kartones /
Last active Jun 5, 2020
PostgreSQL command line cheatsheet


Magic words:

psql -U postgres

Some 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)
You can’t perform that action at this time.