Skip to content

Instantly share code, notes, and snippets.

View brunohcastro's full-sized avatar

Bruno Henrique de Castro brunohcastro

View GitHub Profile
@brunohcastro
brunohcastro / gpg-import-and-export-instructions.md
Created April 3, 2017 17:53 — forked from chrisroos/gpg-import-and-export-instructions.md
Instructions for exporting/importing (backup/restore) GPG keys

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/

or, instead of backing up trustdb...

@brunohcastro
brunohcastro / Commit Formatting.md
Created August 16, 2017 14:40 — forked from clemtibs/Commit Formatting.md
Angular Commit Format Reference Sheet

Git Commit Guidelines

We have very precise rules over how our git commit messages can be formatted. This leads to more readable messages that are easy to follow when looking through the project history. But also, we use the git commit messages to generate the AngularJS change log.

Commit Message Format

Each commit message consists of a header, a body and a footer. The header has a special format that includes a type, a scope and a subject:

@brunohcastro
brunohcastro / README.md
Created September 3, 2017 19:20 — forked from mrkpatchaa/README.md
Bulk delete github repos

Use this trick to bulk delete your old repos or old forks

(Inspired by https://medium.com/@icanhazedit/clean-up-unused-github-rpositories-c2549294ee45#.3hwv4nxv5)

  1. Open in a new tab all to-be-deleted github repositores (Use the mouse’s middle click or Ctrl + Click) https://github.com/username?tab=repositories

  2. Use one tab https://chrome.google.com/webstore/detail/onetab/chphlpgkkbolifaimnlloiipkdnihall to shorten them to a list.

  3. Save that list to some path

  4. The list should be in the form of “ur_username\repo_name” per line. Use regex search (Sublime text could help). Search for ' |.*' and replace by empty.

@brunohcastro
brunohcastro / .gitignore
Created December 12, 2017 20:30 — forked from bergie/.gitignore
Node.js email handling examples
config.json
reading-image.png
@brunohcastro
brunohcastro / download-file.js
Last active November 5, 2018 00:50 — forked from javilobo8/download-file.js
Download files with AJAX (axios)
axios({
url: 'http://localhost:5000/static/example.pdf',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf');
document.body.appendChild(link);

Desafio

Vamos montar uma listagem de blog posts, com usuários e comentários. A API que vamos usar pode ser encontrada no seguinte repositório: https://github.com/typicode/json-server

Tarefa 1 - Listagem de Posts e Comentários