Skip to content

Instantly share code, notes, and snippets.


Tiago Celestino tcelestino

Block or report user

Report or block tcelestino

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View qr-code-gsheets.txt

Cloudflare DNS

  • Serviço padrão:
    • DNS primário:
    • DNS secundário:
  • Filtro de malware:
    • DNS primário:
    • DNS secundário:
  • Filtro de malware e conteúdo adulto:
    • DNS primário:
View reducer-without-switch.js
function reducers(state = initState, action) {
const mapping = {
[ACTION_ONE]: { ...state, token: action.payload },
[ACTION_TWO]: { ...state, error: action.payload }
return mapping[action.type] || state;
View randomString.js
const secret = `${Math.random().toString(36).slice(2)}`;

Mirroring a repository

Open Terminal.

Create a bare clone of the repository.

$ git clone --bare
tcelestino / anagram.js
Created Jul 17, 2019
solutions to code interviews
View anagram.js
// helper function that builds the
// object to store the data
const buildCharObject = str => {
const charObj = {}
for(let char of str.replace(/[^\w]/g).toLowerCase()) {
// if the object has already a key value pair
// equal to the value being looped over,
// increase the value by 1, otherwise add
// the letter being looped over as key and 1 as its value
charObj[char] = charObj[char] + 1 || 1
tcelestino /
Last active Jun 14, 2019
Essentials Docker commands -

Essentials Docker commands

List all essentials command to use Docker. Based on

Running Docker

  • docker start [container]: Start a particular container.
  • docker stop [container]: Stop a particular container.
  • docker exec -ti [container] [command]: Run a shell command inside a particular container.
  • docker run -ti — image [image] [container] [command]: Create and start a container at the same time, and then run a command inside it.
tcelestino / delete-files-netstorage.js
Created Jun 3, 2019
remove files in images directory at Akamai NetStorage
View delete-files-netstorage.js
const deleteImagesFolder = () => {
ns.dir('/cpCode/front-app-home/images', (error, res, body) => {
if (error) {
throw new Error(`Error, ${error.message}`);
if (body.stat !== undefined) {
const { file: files } = body.stat;
files.forEach(file => {
tcelestino /
Created May 20, 2019
alias to docker clean out
# docker
alias dockercleand='docker rmi $(docker images -q)' #delete all images
alias dockercleanu='docker rmi $(docker images -q -f dangling=true)' # delete all untagged images
alias dockercleans='docker rm $(docker ps -a -q)' #delete all stopped images
tcelestino / sanitize.js
Created May 14, 2019
remove accents, switch white-space from hifen and transform string in lowercase
View sanitize.js
const sanitize = str => str.normalize('NFD').replace(/[\u0300-\u036f]/g, '').replace(' ', '-').toLowerCase();
You can’t perform that action at this time.