Skip to content

Instantly share code, notes, and snippets.


Michelle Torres nmicht

View GitHub Profile
nmicht /
Last active Aug 31, 2019
This script do a loop to read all the lines in file "url-list" and with curl get the http code response
# This script do a loop to read all the lines in file "url-list"
# Usign curl with get the http code of the url and print it with the url
while read LINE; do
curl -o /dev/null --silent --head --write-out '%{http_code}' "$LINE"
echo ' '$LINE
done < url-list
#! /bin/bash
# move to your local branch
git checkout local_branch
# pull the remotes
git fetch --all
# merge and squash
git merge origin/dirty_branch --squash
convert -define jpeg:size=800x800 'MC-SFC002 Sófa Cama Queen Aloise.png' -thumbnail '800x800>' \
-gravity center -crop 800x800+0+0\! \
-background white -flatten 'thumbs/MC-SFC002 Sófa Cama Queen Aloise.png'
mogrify -format jpg -path thumbs -thumbnail '300x300>' -gravity center -crop 300x300+0+0\! -background white -flatten *.png
nmicht / CodeSniffer with
Last active Jan 29, 2021
Force PHP standards with Git hooks and Code Sniffer
View CodeSniffer with

Force PHP standards with Git hooks and Code Sniffer

Phpcs Dependency

First, we need a development dependency specified to install phpcs. It looks something like this:

    "require-dev": [
        "squizlabs/php_codesniffer": "2.0.*@dev"
nmicht /
Created Mar 9, 2017
Upgrade MySQL without prompt
#!/usr/bin/env bash
debconf-set-selections <<< 'mysql-apt-config mysql-apt-config/select-tools select MySQL Server (Currently selected: mysql-5.7)'
debconf-set-selections <<< "mysql-apt-config mysql-apt-config/select-preview select mysql-5.7"
debconf-set-selections <<< "mysql-apt-config mysql-apt-config/select-server select mysql-5.7"
debconf-set-selections <<< "mysql-apt-config mysql-apt-config/select-product select Ok"
debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
View .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
nmicht / atom-packages
Last active Jan 8, 2019
Atom packages
View atom-packages
apm install docblockr
apm install atom-wrap-in-tag
apm install php-cs-fixer
apm install goto-definition
apm install todo-show
apm install editorconfig
apm install atom-beautify
apm install aligner
apm install linter-python-pep8
nmicht / reverse_parenthesis.php
Created Aug 11, 2017
Reverse all the content wrapped by parenthesis
View reverse_parenthesis.php
$string = '12(345)6(78)8(012(34(56)7))0123';
$regex = '/(\(\w+\))/';
$result = $string;
while( strpos($resultado,'(') !== false) {
$result = preg_replace_callback($regex, function($matches) {
nmicht / android
Created Sep 16, 2017
View android
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
dependencies {
classpath ''
// NOTE: Do not place your application dependencies here; they belong
nmicht /
Last active Jan 26, 2018
Script to checkout a list of "repos" to certain branch, pull changes and run grunt.

Checkout, pull and run grunt

  1. Copy this bash into your /usr/local/bin folder
  2. Assign execution permissions
  3. Create another file named repos.txt
  4. In repos.txt list with full path each of the repos you want to be part
  5. Update the bash with the full path to your repos.txt file