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
@m-radzikowski
m-radzikowski / script-template.sh
Last active May 4, 2024 04:13
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@Szymongib
Szymongib / warp_log_headers.rs
Created September 19, 2020 07:30
Filter to log request headers using Warp framework
// [dependencies]
// tokio = { version = "0.2", features = ["macros"] }
// warp = "0.2.2"
use warp::Filter;
use warp::http::HeaderMap;
use std::convert::Infallible;
#[tokio::main]
async fn main() {
@Weakky
Weakky / nexus-test-environment.js
Created June 25, 2020 09:22
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'

Unistore Hooks for Preact

Experimental hooks-based bindings for Unistore. Available on npm:

npm i unistore-hooks

Note: this should also work with React, just alias "preact" and "preact/hooks" to "react" in your bundler.

Usage

@ff6347
ff6347 / .vimrc
Last active May 25, 2020 10:27
Some basic vimrc so I can curl it into a ubuntu box
call plug#begin(expand('~/.vim/plugged'))
Plug 'arcticicestudio/nord-vim'
Plug 'sheerun/vim-polyglot'
call plug#end()
filetype indent plugin on
colorscheme nord
syntax on
set autoindent
set backspace=2
set cursorline
@ciiqr
ciiqr / dispatch.sh
Last active May 3, 2024 19:47
github actions, repository_dispatch with client_payload
# TODO: replace :token, :user, and :repo
curl -H "Authorization: token :token" \
-H 'Accept: application/vnd.github.everest-preview+json' \
"https://api.github.com/repos/:user/:repo/dispatches" \
-d '{"event_type": "awesomeness", "client_payload": {"foo": "bar"}}'
@iaurg
iaurg / GeneratePdf.js
Created September 25, 2019 18:44
react-pdf PDFDownloadLink
import React, { Component } from 'react';
import { render, hydrate } from 'react-dom';
import { PDFDownloadLink } from '@react-pdf/renderer';
import { ModelCertificate } from './ModelCertificate';
export default class PDFLink extends Component {
state = {
loading: false,
};
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active June 2, 2024 11:24
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@cilf
cilf / Dockerfile
Last active April 29, 2023 16:44
Adminer MongoDB docker image
FROM adminer:4.7.1
# WATCH OUT WHEN UPGRADING, THE SED BELOW MIGHT STOP WORKING
MAINTAINER marek@cilf.cz
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
@romanlab
romanlab / script.js
Last active March 15, 2019 05:44
basic node js script for github actions
const program = require('commander')
const fs = require('fs')
async function doSomething(arg) { return arg }
async function main() {
const event = JSON.parse(fs.readFileSync('/github/workflow/event.json', 'utf8'))
const firstArg = program.firstArg