Skip to content

Instantly share code, notes, and snippets.

View digitalbocca's full-sized avatar
🚀
Working from home

Gabriel Bertola Bocca digitalbocca

🚀
Working from home
View GitHub Profile
@digitalbocca
digitalbocca / cfonts-servidor-express.js
Last active March 31, 2019 13:44
Mensagem quando inicia o servidor node
app.listen(process.env.PORT, () => {
cfonts.say('edb', {
font: 'block',
colors: ['white', 'gray']
})
cfonts.say(`Servidor EDB funcionando na porta: ${process.env.PORT}`, {
font: 'console',
colors: ['black'],
background: 'green'
})

Here's how you could create custom error classes in Node.js using latest ES6 / ES2015 syntax.

I've tried to make it as lean and unobtrusive as possible.

Defining our own base class for errors

errors/AppError.js

@digitalbocca
digitalbocca / .zshrc
Created April 11, 2019 00:21
Configuração do meu zsh no Deepin Terminal no Ubuntu.
# 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
@digitalbocca
digitalbocca / VIM-to-Clipboard.md
Last active April 11, 2019 00:45
Copiar do VIM para Área de Transferência.

Copiar do VIM para Área de Transferência

TENTATIVAS

  • Entrar no modo VISUAL e selecionar o texto todo.
  • y

  • Entrar no modo VISUAL e selecionar o texto todo.
@digitalbocca
digitalbocca / purgecss.config.js
Created April 17, 2019 04:39
Configuração do plugin parcel-plugin-purgecss
module.exports = {
content: ['**/*.pug']
}
@digitalbocca
digitalbocca / profile.txt
Last active July 7, 2019 10:50
Exportar vídeo com fundo transparente no KDENLIVE. Usado para transições do OBS. Formato mkv
f=matroska pix_fmt=bgra acodec=aac vcodec=ffv1 qscale=%quality ab=%audiobitrate+'k'
@digitalbocca
digitalbocca / npx-gist.js
Last active August 22, 2019 15:13
Teste de execução do npx com gist.
#!/usr/bin/env node
console.log('Em todos esses anos nesta industria vital, é a primeira vez que isso acontece...')
@digitalbocca
digitalbocca / arquivo.MD
Created December 11, 2019 08:39
Descompactar arquivo bz2

Descompactar Arquivo bz2


tar -xvjf file.tar.bz2

Flags

  • -x - Extrair
@digitalbocca
digitalbocca / JAVASCRIPT-VANILLA.md
Last active January 20, 2020 13:42
ImagemBase64 - Arquivo JS
'use strict'

// IMPORTAR O AXIOS PARA FAZER A CHAMADA HTTP
import axios from 'axios'

// INÍCIO DA EXECUÇÃO
window.onload = async () => {
  try {
 // GET PARA A API