Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const randomItem = (itemsArray) => itemsArray[Math.floor(Math.random() * itemsArray.length)]; | |
const makeFantasyAnimal = () => { | |
const animales = ['perro', 'gato', 'jirafa']; | |
const verbos = ['escupe', 'caga', 'estornuda']; | |
const elementos = ['fuego', 'hielo', 'moco']; | |
return `${randomItem(animales)} ${randomItem(verbos)} ${randomItem(elementos)}`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const randomItem = (itemsArray) => itemsArray[Math.floor(Math.random() * itemsArray.length)]; | |
const makeFantasyAnimal = () => { | |
const animales = ['perro', 'gato', 'jirafa']; | |
const verbos = ['escupe', 'caga', 'estornuda']; | |
const elementos = ['fuego', 'hielo', 'moco']; | |
return `${randomItem(animales)} ${randomItem(verbos)} ${randomItem(elementos)}`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- PSQL queries which also duplicated from https://github.com/anvk/AwesomePSQLList/blob/master/README.md | |
--- some of them taken from https://www.slideshare.net/alexeylesovsky/deep-dive-into-postgresql-statistics-54594192 | |
-- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB. | |
------------ | |
-- Basics -- | |
------------ | |
-- Get indexes of tables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sample code taken from | |
// https://medium.com/easy-apps-with-hyperhtml/easy-apps-with-hyperhtml-2-1d60fd41bb67 | |
// under "Components" subtitle | |
import hyperHTML from 'https://unpkg.com/hyperhtml?module'; | |
const Table = { | |
html: hyperHTML.bind(document.getElementById('table')), | |
data: [ | |
{ label: 'one', value: 1 }, |
The following shell transcript shows how to:
- Create a GPG key
- Create a pass database
- Add git support to the pass database
- Create a remote git repository
- Push the pass database to the remote git repository
- Fetch and display your passwords from another host
It is assumed that the pass
package has been installed on both the first and second computers.
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');
Those suck for maintenance and they're ugly.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
// sample usage of util.parseArgs | |
import {parseArgs} from 'node:util'; | |
const options = { | |
help: { | |
type: 'boolean', |