Skip to content

Instantly share code, notes, and snippets.

View devdrops's full-sized avatar
🔥
Paz Entre Nós, Guerra Aos Senhores

Davi Marcondes Moreira devdrops

🔥
Paz Entre Nós, Guerra Aos Senhores
View GitHub Profile
@devdrops
devdrops / instructions.md
Last active May 25, 2017 19:15
Go Travis Go!

Go Travis Go!

Kudos para @MarcoWorms por criar o script original - eu só fiz como bookmark e coloquei os ponto-e-vírgula :D

  1. Crie uma nova bookmark no Chrome;
  2. Em Bookmark Manager, edite o conteúdo da Bookmark colocando o trecho de código abaixo:
javascript:(function(){window.setInterval(() => document.querySelectorAll('.jobs-item.failed').forEach(build => {console.log('Restarting build', build.querySelector('.job-env').textContent.trim(), (new Date()).toString()); build.querySelector('.action-button--restart').click(); }), 5000); }());
@devdrops
devdrops / config.cson
Created March 31, 2017 22:30
Atom settings
"*":
core:
audioBeep: false
themes: [
"one-dark-ui"
"monokai"
]
editor:
scrollPastEnd: true
showIndentGuide: true
@devdrops
devdrops / tip.md
Last active March 13, 2017 19:37
Run PHP CodeSniffer for all changed/new files on Git, using Docker

Run PHP CodeSniffer for all changed/new files on Git, using Docker

  • The -a flag instructs phpcs to execute interactively, so then you can edit the files and re-check it again with no need to run the same phpcs command again. Awesome, eh?
  • The Git part:
    • git status --porcelain will show us all files and their state: ?? for a new one, M for modified;
    • We combine egrep and cut to give us exactly what we want, a perfect list.
    • We put this as a subcommand to pass the expected file list to phpcs.
  • Docker here is a mere tool. You can enjoy the same functionality with or without it 😉
@devdrops
devdrops / checklist.md
Created December 30, 2016 21:11
Magento on Docker checklist

Magento on Docker

Why?

We constantly have to create, drop and recreate a new Magento installation, and it takes too much time to finish (~20 minutes) and start lots of settings like customer address, catalog, and such. It takes more time to execute these steps than actually testing what we're looking for.

In order to make the instalation as easy as possible, we need to create a resource with all the basic settings already defined, instead of creating every time from scratch.

Approaches

@devdrops
devdrops / example.md
Last active March 19, 2025 16:01
Mysqldump from Docker container

Mysqldump from Docker container

docker exec -i mysql_container mysqldump -uroot -proot --databases database_name --skip-comments > /path/to/my/dump.sql

OBS

  • This will generate a dump.sql file in your host machine. Awesome, eh?
  • Avoid using --compact on your dump. This will make MySQL check your constraints which will cause troubles when reading your file (damm you MySQL). And don't use --force to fix this scenario: recreate your dump without --compact ¯_(ツ)_/¯
@devdrops
devdrops / .env
Created December 16, 2016 18:40
Docker environment (magento-flavoured)
# MYSQL
MYSQL_ROOT_PASSWORD=root
MYSQL_DATABASE=magento
MYSQL_USER=magento
MYSQL_PASSWORD=1234
@devdrops
devdrops / contents.md
Last active December 8, 2016 03:54
Telegram Update Requests

TELEGRAM BOTS

Atualizações

IDENTIFICADOR DE COMANDOS

Tanto em conversa privada como em grupo, um update sempre terá um comando quando tiver no mínimo uma entidade do tipo bot_command. Porquê no mínimo? Porque o atributo entities que existe num update com comandos é um array, o que significa que tecnicamente é possível ter mais de 1 entidade em um único update.

OBS: se não há o atributo entities na mensagem, o update deve ser ignorado pelo bot.

@devdrops
devdrops / messageOfTheDay.sh
Created December 2, 2016 19:40
Message of the Day: randomize a quote on terminal.
#!/bin/bash
#######################################################
# MESSAGE OF THE DAY
#
# Randomize a quote.
#
# AUTHOR: @devdrops <[email protected]>
#######################################################
@devdrops
devdrops / test.sh
Created November 24, 2016 21:08
Bash: prompt usage
#!/bin/bash
#FOO=$1
#echo $FOO
echo -n 'What is your favorite color? '
read color
echo $color
@devdrops
devdrops / Preferences.sublime-settings.json
Last active November 21, 2016 20:11
Sublime Text 3 Personal Settings
{
"translate_tabs_to_spaces": true,
"tab_size": 4,
"line_numbers": true,
"save_on_focus_lost": true,
"remember_full_screen": true
}