Skip to content

Instantly share code, notes, and snippets.

View viniciusdaniel's full-sized avatar

Vinicius Daniel Antunes Oliveira viniciusdaniel

View GitHub Profile

Bash tips: Colors and formatting (ANSI/VT100 Control sequences)

The ANSI/VT100 terminals and terminal emulators are not just able to display black and white text ; they can display colors and formatted texts thanks to escape sequences. Those sequences are composed of the Escape character (often represented by “^[” or “<Esc>”) followed by some other characters: “<Esc>[FormatCodem”.

In Bash, the <Esc> character can be obtained with the following syntaxes:

  • `\e`
ADOBE Creative Suite 5 Master Collection
1023-1631-3275-3276-0087-5426
1325-1576-4130-9475-8280-4266
1325-1548-7004-9142-5077-1912
1325-1684-1405-3432-6260-7438
1325-1238-0019-6636-5160-2146
1325-1966-4532-5397-9277-9204
@viniciusdaniel
viniciusdaniel / google-hacking-techniques.md
Last active November 27, 2023 19:46
COPY - Exploring Google Hacking Techniques
@viniciusdaniel
viniciusdaniel / d3js.pt-br.js
Created October 29, 2014 23:01
D3.js localize pt-BR for time and number formatting
/**
* Configuração de localização em Português do Brasil(PT-BR) para o D3.js realizar formatação tempo e números
* Mais detalhes conferir a documentação: https://github.com/mbostock/d3/wiki/Time-Formatting
*/
var localized = d3.locale({
"decimal": ",",
"thousands": ".",
"grouping": [3],
"currency": ["R$", ""],
@viniciusdaniel
viniciusdaniel / SWAP-101.md
Created September 26, 2023 14:33 — forked from vpnwall-services/SWAP-101.md
[SWAP 101] Swap 101 #linux #swap #101

SWAP 101

  • Allocate swap sudo fallocate -l 1G /swapfile

  • Alternate allocation sudo dd if=/dev/zero of=/swapfile bs=1024 count=1048576

  • Perms

@viniciusdaniel
viniciusdaniel / bash-cheatsheet.sh
Created February 23, 2017 19:19 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@viniciusdaniel
viniciusdaniel / emberjs.md
Created May 4, 2017 18:15
emberjs javascript frontend spa single app application
@viniciusdaniel
viniciusdaniel / psql-with-gzip-cheatsheet.sh
Created May 28, 2021 03:16 — forked from brock/psql-with-gzip-cheatsheet.sh
Exporting and Importing Postgres Databases using gzip
# This is just a cheat sheet:
# On production
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz
# On local
scp -C production:~/database.sql.gz
dropdb database && createdb database
gunzip < database.sql.gz | psql database
@viniciusdaniel
viniciusdaniel / cnpj_validator.php
Last active May 6, 2021 23:26 — forked from guisehn/gist:3276302
Validar CNPJ (PHP)
<?php
function validar_cnpj($cnpj)
{
// Limpa caracteres e mantem apenas dígitos
$cnpj = preg_replace('/[^0-9]/', '', (string) $cnpj);
// Valida tamanho
if (strlen($cnpj) != 14)
return false;
@viniciusdaniel
viniciusdaniel / cpf_validator.php
Last active May 6, 2021 23:23 — forked from guisehn/gist:3276015
Validar CPF (PHP)
<?php
function validar_cpf($cpf)
{
// Limpa caracteres e mantem apenas dígitos
$cpf = preg_replace('/[^0-9]/', '', (string) $cpf);
// Valida tamanho
if (strlen($cpf) != 11)
return false;