Skip to content

Instantly share code, notes, and snippets.

View fernandovaller's full-sized avatar
🏠
Working from home

Fernando Valler fernandovaller

🏠
Working from home
View GitHub Profile
@fernandovaller
fernandovaller / script-export-phases-files.js
Last active December 27, 2021 12:58
Script para exportar etapas e arquivos das trilhas do LMS
let nome_curso = ($('h1.cor1_color span').text()).replaceAll(':', '');
nome_curso = $.trim(nome_curso);
let trilha = document.querySelector("#select2-chosen-5").innerText;
nome_curso = `${nome_curso}-${trilha}`;
var etapa_itens = [];
var data = [];
$('li.stepContainer').each(function(i, e){
etapa_itens = [];
@fernandovaller
fernandovaller / ffmpeg.txt
Last active December 9, 2021 13:24
Samples for ffmpeg
# Split video
ffmpeg -i video.mp4 -ss 00:00:10 -to 00:00:20 -c copy video_out.mp4
# Rotate
ffmpeg -i video.mp4 -vf "transpose=1" video_out.mp4
# Rotate transpose
0 = 90CounterCLockwise and Vertical Flip (default)
1 = 90Clockwise
2 = 90CounterClockwise
@fernandovaller
fernandovaller / add-class-active.js
Created October 15, 2021 12:06
Add class active for menu
// Exemplo de como adicona a class CSS active no link que estiver sendo acessado
$(document).ready(function() {
// Get path
let uri = (window.location.pathname).split('/');
// Option 1
$('nav .nav-link').filter(`a[href="/admin/${uri[2]}"], a[href="/${uri[1]}"]`).addClass('active');
// Option 2
@fernandovaller
fernandovaller / list-icon-fontawesome.json
Created October 14, 2021 13:57
list icon fontawesome in json
{
"icones":[
"fa-address-book",
"fa-address-book-o",
"fa-address-card",
"fa-address-card-o",
"fa-bandcamp",
"fa-bath",
"fa-bathtub",
"fa-drivers-license",
@fernandovaller
fernandovaller / list-icon-fontawesome.txt
Created October 14, 2021 13:46
list icon fontawesome
fa-address-book
fa-address-book-o
fa-address-card
fa-address-card-o
fa-bandcamp
fa-bath
fa-bathtub
fa-drivers-license
fa-drivers-license-o
fa-eercast
@fernandovaller
fernandovaller / post-receive
Created March 6, 2021 12:15
Git hook with composer install
#Usado em hospedagens sem composer global
#!/bin/sh
work_tree=/home/my-project
GIT_WORK_TREE=$work_tree git checkout -f
cd $work_tree
php ~/composer install --no-dev --no-scripts --optimize-autoloader
@fernandovaller
fernandovaller / Log.php
Created March 5, 2021 12:03
Class de log em PHP e SQLite
<?php
/*
* Class de Log usando SQLite3
* By Fernando Valler
* Obs: definir um nome unico para base
*
* Exemplos
* //insert
* Log::add('REGISTRO DE LOG DO SISTEMA '. date("G:i"), 'ADMIN', 1);
* echo '<hr>';
@fernandovaller
fernandovaller / xampp_php7_xdebug.md
Created July 31, 2020 19:37 — forked from odan/xampp_php7_xdebug.md
Installing Xdebug for XAMPP
@fernandovaller
fernandovaller / post-receive
Created July 14, 2020 18:37
Git Hooks - Samples
#!/bin/sh
GIT_WORK_TREE=/path-your-app git checkout -f
@fernandovaller
fernandovaller / export-big-data.php
Created May 8, 2020 18:31
Script em PHP para exportar grande quantidade de dados em CSV
<?php
/**
* This script performs a full dump of a database query into
* CSV format and pipes it directly to the browser.
*
* - YES, the browser will save the CSV file to disk
* - YES, it should support large files without using massive amounts of memory
* - YES, it compresses the request using GZIP to reduce download time
*/