Skip to content

Instantly share code, notes, and snippets.

View ff6347's full-sized avatar
🤖
updating status…

Fabian Morón Zirfas ff6347

🤖
updating status…
View GitHub Profile
@ff6347
ff6347 / README.md
Last active December 3, 2023 13:52 — forked from versionsix/README.md
OmniGraffle: Export layers on top of base-layer as PNG

Layer export for OmniGraffle

If you have a Graffle document (doc.graffle) with a canvas named "mycanvas" holding the following layers ...

  • Extra 3
  • Extra 2
  • Extra 1
  • Base

... then these images will be generated:

@ff6347
ff6347 / README.md
Last active December 20, 2022 11:53 — forked from JonDotsoy/README.md
Conventional Commits to Terminal (zsh, sh)

Conventional Commits to Terminal (zsh, sh)

Git alias conventional-commit and m to create conventional commits so fast. And prepare the scope with the alias git scope <scope-name>.

image

How to install

Run the next line in your shell terminal

@ff6347
ff6347 / esm-package.md
Created June 7, 2022 11:59 — forked from sindresorhus/esm-package.md
Pure ESM package

Pure ESM package

The package linked to from here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@ff6347
ff6347 / server.py
Created October 6, 2021 08:01 — forked from ljack/server.py
python 3 http server with tail file
from os import listdir,SEEK_END
from os.path import isfile, join, getmtime
from http.server import BaseHTTPRequestHandler, HTTPServer
import socketserver
import time
import subprocess
import select
from urllib.parse import parse_qs,urlparse
import logging
import sys, os, socket
@ff6347
ff6347 / webtail.py
Created October 5, 2021 14:12 — forked from scoffey/webtail.py
HTTP server that provides a web interface to run "tail" on a file, like the Unix command
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
HTTP server that provides a web interface to run "tail" on a file,
like the Unix command.
This is a standalone script. No external dependencies required.
How to invoke:
@ff6347
ff6347 / pg_random_int_array.sql
Created May 17, 2021 14:56 — forked from ekho/pg_random_int_array.sql
Postgresql function for generating random integer array
CREATE OR REPLACE FUNCTION random_int_array(dim integer, min integer, max integer) RETURNS integer[] AS $BODY$
begin
return (select array_agg(round(random() * (max - min)) + min) from generate_series (0, dim));
end
$BODY$ LANGUAGE plpgsql;
-- usage example
select random_int_array(15, 6, 40);
-- return example
@ff6347
ff6347 / how-to-copy-aws-rds-to-local.md
Created July 2, 2020 08:45 — forked from syafiqfaiz/how-to-copy-aws-rds-to-local.md
How to copy production database on AWS RDS(postgresql) to local development database.
  1. Change your database RDS instance security group to allow your machine to access it.
    • Add your ip to the security group to acces the instance via Postgres.
  2. Make a copy of the database using pg_dump
    • $ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>
    • you will be asked for postgressql password.
    • a dump file(.sql) will be created
  3. Restore that dump file to your local database.
    • but you might need to drop the database and create it first
    • $ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>
  • the database is restored
@ff6347
ff6347 / nexus-test-environment.js
Created June 25, 2020 17:35 — forked from Weakky/nexus-test-environment.js
SQLite jest environment for Nexus & Prisma
// tests/nexus-test-environment.js
const NodeEnvironment = require('jest-environment-node')
const { nanoid } = require('nanoid')
const util = require('util')
const exec = util.promisify(require('child_process').exec)
const fs = require('fs')
const path = require('path')
const prismaBinary = './node_modules/.bin/prisma'
@ff6347
ff6347 / Dockerfile
Created April 15, 2020 08:10 — forked from cilf/Dockerfile
Adminer MongoDB docker image
FROM adminer:4.7.1
# WATCH OUT WHEN UPGRADING, THE SED BELOW MIGHT STOP WORKING
MAINTAINER [email protected]
USER root
RUN apk add autoconf gcc g++ make libffi-dev openssl-dev
RUN pecl install mongodb
RUN echo "extension=mongodb.so" > /usr/local/etc/php/conf.d/docker-php-ext-mongodb.ini