Skip to content

Instantly share code, notes, and snippets.

View alexcmgit's full-sized avatar

Alex Castro alexcmgit

View GitHub Profile
@alexcmgit
alexcmgit / git.md
Created May 19, 2020 15:59 — forked from leocomelli/git.md
Lista de comandos úteis do GIT

GIT

Estados

  • Modificado (modified);
  • Preparado (staged/index)
  • Consolidado (comitted);

Ajuda

function abbreviateNumber(num) {
return Math.abs(num) > 999
? Math.sign(num) * (Math.abs(num) / 1000).toFixed(1) + 'k'
: Math.sign(num) * Math.abs(num);
}
function interpolate(xInterval, yInterval) {
let [x0, x1] = xInterval;
let [y0, y1] = yInterval;
return function (xA) {
if (xA > x1) xA = x1;
else if (xA < x0) xA = x0;
const yA = y0 + (y1 - y0) * ((xA - x0) / (x1 - x0));
@alexcmgit
alexcmgit / colorful.js
Created March 22, 2020 21:09
Pack of 4 Gists to create awesome random colors and palette colors
function generateRandomNumber(min, max) {
return Math.floor(Math.random() * (max - min + 1) + min);
}
function generateRandomColor(userConfig = {}) {
const defaultConfig = {
r: [0, 255],
g: [0, 255],
b: [0, 255],
a: [1, 1],
function generateRandomColorPalette(userColor = {}, userVariant = {}) {
const { color: defaultColor } = generateRandomColor();
const defaultVariant = { vR: 15, vG: 15, vB: 15, vA: 200 };
const color = Object.assign({}, defaultColor, userColor);
const variant = Object.assign({}, defaultVariant, userVariant);
const { r, g, b, a } = color;
.no-highlight-on-cursor-pointer{
-webkit-tap-highlight-color: transparent;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
<a class="icon-container" target="_blank" rel="noopener noreferrer external" href="https://mail.google.com/mail/u/0/?view=cm&fs=1&[email protected]&tf=1"></a>
rel="noopener noreferrer external"
index.js
if (process.env.DEVELOPMENT) {
const ngrok = require("ngrok");
(async function() {
try {
const url = await ngrok.connect({
proto: "http",
addr: process.env.PORT
});
console.log("Tunnel Created -> ");
@import url('https://fonts.googleapis.com/css?family=Josefin+Sans&display=swap');
font-family: 'Josefin Sans', sans-serif;
@import url('https://fonts.googleapis.com/css?family=Courier+Prime&display=swap');
font-family: 'Courier Prime', monospace;