Skip to content

Instantly share code, notes, and snippets.

View fernandocanizo's full-sized avatar
🎃
Working from home

Fernando Lucio Canizo fernandocanizo

🎃
Working from home
View GitHub Profile
@fernandocanizo
fernandocanizo / test.geojson
Created September 28, 2017 15:30
Testing geojson gists
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fernandocanizo
fernandocanizo / test2.geojson
Last active September 28, 2017 15:43
Testing geojson gist 2
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
'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)}`;
@fernandocanizo
fernandocanizo / fantasy.animal.generator.js
Last active May 8, 2018 13:36
fantasy animal generator
'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)}`;
@fernandocanizo
fernandocanizo / psql_useful_stat_queries.sql
Created February 20, 2019 15:33 — forked from anvk/psql_useful_stat_queries.sql
List of some useful Stat Queries for PSQL
--- 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
@fernandocanizo
fernandocanizo / not-working-hyperhtml-component
Created March 2, 2020 21:56
Non working hyperhtml component
// 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 },
@fernandocanizo
fernandocanizo / passgitgpg.md
Created June 18, 2021 09:11 — forked from flbuddymooreiv/passgitgpg.md
Setting up pass on git with a gpg key

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.

@fernandocanizo
fernandocanizo / better-nodejs-require-paths.md
Created November 11, 2021 16:40 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

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.

Possible solutions

@fernandocanizo
fernandocanizo / util.parseArgs.mjs
Created August 18, 2022 15:36
a simple sample usage for node:util.parseArgs
#!/usr/bin/env node
// sample usage of util.parseArgs
import {parseArgs} from 'node:util';
const options = {
help: {
type: 'boolean',