Skip to content

Instantly share code, notes, and snippets.

View alandbh's full-sized avatar

Alan Vasconcelos alandbh

View GitHub Profile
@alandbh
alandbh / vjoin.sh
Last active August 25, 2025 18:49
Bash Script for Joining Videos
#!/bin/bash
# vjoin: Junta dois vídeos usando nomes parciais e concatena com ou sem reencodificação
# Uso: vjoin <arquivo1-parcial> <arquivo2-parcial> [nome-destino] [--force]
# ------------------------------------------
# Instalando como comando global vjoin
# ------------------------------------------
# Salve o script acima com o nome vjoin (sem .sh).
@alandbh
alandbh / vcut.sh
Last active August 25, 2025 18:48
Bash Script For Cutting Videos.
#!/bin/bash
# vcut: Corta um trecho de um vídeo baseado no nome parcial e tempos de início/fim.
# Uso:
# vcut <nome-parcial> <início-MM:SS> <fim-MM:SS> [nome-destino-sem-extensão]
# ------------------------------------------
# Instalando como comando global vcut
# ------------------------------------------
@alandbh
alandbh / vcompress.sh
Last active August 25, 2025 18:45
Bash Script For Compressing Videos
#!/bin/bash
# vcompress: comprime um vídeo encontrado por nome parcial.
# Uso:
# vcompress <nome-parcial> [--height <H>] [--crf <N>] [--noaudio]
#
# Padrões:
# --height <H> Altura do vídeo (padrão: 1440). Ex.: 720, 900, 1080, 1440
# --crf <N> Qualidade CRF (padrão: 20). 0–51 (menor = melhor)
# --noaudio Remove a trilha de áudio
#
@alandbh
alandbh / docker_wordpress.md
Created June 25, 2020 17:03 — forked from bradtraversy/docker_wordpress.md
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
@alandbh
alandbh / mysql-docker.sh
Created April 24, 2020 00:02 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@alandbh
alandbh / date_i18n
Created June 21, 2019 04:51
Wordpress built-in function to display international dates properly. Retrieve the date in localized format, based on timestamp.
$_evento = get_proximos_eventos(1);
$evento = $_evento[0];
$unixtimestamp_inicio = strtotime($evento['data_inicio']);
echo date_i18n('M', $unixtimestamp_inicio); // Abril
// Depending on your blog settings you will see the date displayed in your local format, for example: 15. november 1976.
echo date_i18n( get_option( 'date_format' ), strtotime( '11/15-1976' ) );
@alandbh
alandbh / fontface-sass-mixin
Last active April 5, 2019 21:57
Sass mixing for importing web-fonts
// =============================================================================
// String Replace
// =============================================================================
@function str-replace($string, $search, $replace: '') {
$index: str-index($string, $search);
@if $index {
@return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
}
@alandbh
alandbh / _spacing-helpers.scss
Created March 22, 2019 22:52 — forked from jacurtis/_spacing-helpers.scss
SASS Margin and Padding Helpers Loop. Generates .m-t-10 type helper classes.
/*
This .scss loop will create "margin helpers" and "padding helpers" for use in your web projects.
It will generate several classes such as:
.m-r-10 which gives margin-right 10 pixels.
.m-r-15 gives MARGIN to the RIGHT 15 pixels.
.m-t-15 gives MARGIN to the TOP 15 pixels and so on.
.p-b-5 gives PADDING to the BOTTOM of 5 pixels
.p-l-40 gives PADDING to the LEFT of 40 pixels
@alandbh
alandbh / Message.jsx
Last active September 17, 2017 03:58
React/Material UI - Inplace Message component
/* ----------------
This is an inplace message component (not dialog, toaster, snackbar or modal)
It must be used with Material UI
Usage:
<Message
type="success"
title="Congratulations!"
content="Your documents fulfill all the requirements. We'll contact you soon." />
@alandbh
alandbh / gallery_wp_2.0.php
Last active September 17, 2017 03:30
Galeria wp 2.0