Skip to content

Instantly share code, notes, and snippets.

View fabioars's full-sized avatar
:octocat:

Fabio Soares fabioars

:octocat:
View GitHub Profile
@fabioars
fabioars / doc.adoc
Last active April 1, 2023 12:26 — forked from KrustyHack/doc.adoc
proxmox-ubuntu-cloud-howto

Cloud-Init Support

Cloud-Init is the defacto multi-distribution package that handles early initialization of a virtual machine instance. Using Cloud-Init, one can configure network

# Clean, simple, compatible and meaningful.
# Tested on Linux, Unix and Windows under ANSI colors.
# It is recommended to use with a dark background.
# Colors: black, red, green, yellow, *blue, magenta, cyan, and white.
#
# Mar 2013 Yad Smood
# VCS
YS_VCS_PROMPT_PREFIX1=" %{$fg[white]%}on%{$reset_color%} "
YS_VCS_PROMPT_PREFIX2=":%{$fg[cyan]%}"
@fabioars
fabioars / cls.js
Created January 21, 2021 18:39 — forked from martinschierle/cls.js
Cumulative Layout Shift (CLS) with Puppeteer
const puppeteer = require('puppeteer');
const devices = require('puppeteer/DeviceDescriptors');
const Good3G = {
'offline': false,
'downloadThroughput': 1.5 * 1024 * 1024 / 8,
'uploadThroughput': 750 * 1024 / 8,
'latency': 40
};
<?php
interface PagamentoInteface {
public function pagar();
}
interface PegamentoCancelavelInteface extends PagamentoInteface {
public function cancelar();
}
#include <stdio.h>
// Cria uma estrutura para leitura do circuito
typedef struct {
float potenciaDijuntor;
float corrente;
float tensao;
} Circuito;
// Cria assinatura da função que vai soar o alarme
Shortcut Keys Function
Main
Escape key Gets out of the current mode into the “command mode”. All keys are bound of commands.
i “Insert mode” for inserting text. Keys behave as expected.
: “Last-line mode” where Vim expects you to enter a command such as to save the document.
Navigation keys
h
import anime from 'animejs';
const cartButton = document.querySelector('.header__cart');
const cartIndicator = document.querySelector('.delivery__cart-indicator');
document.body.addEventListener('click', event => {
const { pageX, pageY } = event;
const bodyRect = document.body.getBoundingClientRect();
const cartButtonRect = cartButton.getBoundingClientRect();
const cart = {
@fabioars
fabioars / adiciona_items.sql
Last active September 5, 2018 00:28
Autopeças
INSERT INTO
clientes (cod_cliente, nome, cpf, rg, endereco, bairro, nome_cidade, estado, cep, email, ddd, telefone )
VALUES
(1, 'Maria José Silva', '123 254 254 01', '12548', 'Rua Seis', 'Centro', 'São Luis', 'Maranhao', '65930820', '[email protected]', '98', '99918 8590')
(2, 'Marta jose', '897 254 354 11', '58964', 'Rua sete ', 'C.olimpica', 'São Luis', 'Maranhao', '65730125', '[email protected]', '98', '99918 8590')
(3, 'Maria das dores ', '143 254 254 0', '12558', 'Rua oito', 'Turu', 'São Luis', 'Maranhao', '65940120', '[email protected]', '98', '99918 8590')
(4, 'carlos Gustavo ', '126 254 254 0', '13548', 'Rua nove', 'janaina', 'São Luis', 'Maranhao', '65930120', '[email protected]', '98', '99918 8590')
INSERT INTO
@fabioars
fabioars / README-Template.md
Created June 22, 2018 20:34 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@fabioars
fabioars / throttle.js
Created January 15, 2018 21:28 — forked from bcole808/throttle.js
Throttle Javascript Functions
/**
* Debounce a function so that it will only fire once
*
* USAGE EXAMPLE:
* $scope.search = debounce(performSearch, 500); // Bind to ng-keyup
*
* http://davidwalsh.name/javascript-debounce-function
*
* @param func [Function] - The function to execute