Skip to content

Instantly share code, notes, and snippets.

View gabrielsaints's full-sized avatar
:octocat:

Gabriel Santos gabrielsaints

:octocat:
View GitHub Profile
const truncate = (label, divisor, precision = 1) => {
if(!label){
return label
}
const labelSplited = label.split(divisor);
const hiddenNames = ['DOS', 'DAS', 'DE', 'DO'];
const divisors = labelSplited.map((element, index) => {
if (!index || index + 1 === labelSplited.length) {
import chalk from 'chalk';
import fs from 'fs';
import root from 'app-root-path';
import stripAnsi from 'strip-ansi';
chalk.enabled = true;
chalk.level = 3;
const { log } = console;
const MONTH_NAMES = [
'Janeiro', 'Fevereiro', 'Março', 'Abril', 'Maio', 'Junho',
'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro',
];
function getFormattedDate(date, prefomattedDate = false, hideYear = false) {
const day = date.getDate();
const month = MONTH_NAMES[date.getMonth()];
const year = date.getFullYear();
@gabrielsaints
gabrielsaints / stun-servers-list.txt
Created August 30, 2019 16:34
List of stun servers
23.21.150.121:3478
iphone-stun.strato-iphone.de:3478
numb.viagenie.ca:3478
s1.taraba.net:3478
s2.taraba.net:3478
stun.12connect.com:3478
stun.12voip.com:3478
stun.1und1.de:3478
stun.2talk.co.nz:3478
stun.2talk.com:3478
@gabrielsaints
gabrielsaints / .editorconfig
Last active October 31, 2019 14:49
vscode configs
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/home/gabriel/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
#include <stdio.h>
/**
* Sequência de Fibonacci otimizada com Inline Assembly
*/
int fib(int n)
{
register int r = 0;
__asm__(
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/home/gabriel/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
@gabrielsaints
gabrielsaints / cep.js
Created July 2, 2019 19:21
Validador de CEP por regex
/([0-9]{5}[-])([0-9]){3}$/.test('17055-175')
<?php
$vehicle = array("b"=>"Bus","t"=>"Truck");
print_r(array_change_key_case($vehicle, CASE_UPPER));
?>
/*
OUTPUT
Array
(
[B] => Bus