Skip to content

Instantly share code, notes, and snippets.

@viniciusbig
viniciusbig / pagespeed_optimize_images.sh
Created Jun 19, 2020 — forked from julianxhokaxhiu/pagespeed_optimize_images.sh
Recursively optimize all PNG and JPG files wherever they are from the script position and inner ( based on OPTING, PNGCRUSH, ADVANCECOMP and JPEGOPTIM )
View pagespeed_optimize_images.sh
#!/bin/bash
# Improved as per feedback from @pascal - https://gist.github.com/julianxhokaxhiu/c0a8e813eabf9d6d9873#gistcomment-3086462
find . -type f -iname "*.png" -exec optipng -nb -nc {} \;
find . -type f -iname "*.png" -exec advpng -z4 {} \;
find . -type f -iname "*.png" -exec pngcrush -rem gAMA -rem alla -rem cHRM -rem iCCP -rem sRGB -rem time -ow {} \;
find . -type f \( -iname "*.jpg" -o -iname "*.jpeg" \) -exec jpegoptim -f --strip-all {} \;
@viniciusbig
viniciusbig / dropboxOrganize.py
Created May 18, 2020 — forked from dansku/dropboxOrganize.py
Script to organize pictures uploaded from Mobile Devices to Dropbox's Camera Upload folder
View dropboxOrganize.py
################################################################################################
#
# Script to organize pictures uploaded from Mobile Devices to Dropbox's Camera Upload folder
#
# Daniel Spillere Andrade - www.danielandrade.net
#
################################################################################################
import os, time
import glob
@viniciusbig
viniciusbig / frete-gratis.txt
Created Oct 24, 2019 — forked from pauloiankoski/frete-gratis.txt
Frete grátis por região no WooCommerce
View frete-gratis.txt
Para quem quiser liberar Frete Grátis por cidade/região faça o seguinte:
Na administração do seu site clique na barra lateral esquerda em
WooCommerce>Configurações>Entrega>Entrega Local
1º Ative a entrega local
2º Altere o titulo para: Frete Grátis
@viniciusbig
viniciusbig / wp-start.sh
Created Sep 20, 2019 — forked from ethicka/wp-start.sh
WordPress Installation with the Roots/Sage Framework and VirtualHost Creation
View wp-start.sh
#!/bin/bash -e
##
# WordPress Installation and VirtualHost Creation
#
# Description: Installs a WordPress website in the ~/Sites folder, creates a homepage,
# cleans up the WP install a bit, deletes the akismet and hello dolly plugins, creates the permalinks,
# clones the roots/sage theme framework to the theme folder, deletes all the other WP default themes,
# installs/runs npm and bower and runs gulp to create the initial assets, adds a custom gitignore file
# to /wp-content, installs the roots/soil plugin, creates a git repo in wp-content, saves the WordPress
@viniciusbig
viniciusbig / 80-keychron.rules
Created Sep 4, 2019 — forked from ercoppa/80-keychron.rules
K2 Keychron Ubuntu 18.04
View 80-keychron.rules
SUBSYSTEMS=="input", ATTRS{name}=="Keychron K2", RUN+="/bin/sh -c 'echo 0 > /sys/module/hid_apple/parameters/fnmode'"
@viniciusbig
viniciusbig / wp.sh
Created Jan 16, 2019 — forked from bgallagh3r/wp.sh
Wordpress: Bash Install Script -- Downloads latest WP version, updates wp-config with user supplied DB name, username and password, creates and CHMOD's uploads dir, copies all the files into the root dir you run the script from, then deletes itself!
View wp.sh
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Database Name: "
read -e dbname
echo "Database User: "
read -e dbuser
echo "Database Password: "
View gist:f0ffc9db7ca05c0bdba42b5b711a6b03
<?php
/*
Increase or decrease value in CakePHP with little footprint.
Add this to your AppModel.
Usage:
(in Controller)
$this->Model->increase('field_name', 1);
@viniciusbig
viniciusbig / deploy.php
Created Sep 13, 2018 — forked from sakanaproductions/deploy.php
PHP Deployer Config File for VPS on Dreamhost
View deploy.php
<?php
namespace Deployer;
require 'recipe/laravel.php';
// Project name
set('application', '');
// Project repository
set('repository', 'git@bitbucket.org');
@viniciusbig
viniciusbig / dreamhost-php.md
Created Aug 9, 2018 — forked from nissicreative/dreamhost-php.md
Update PHP and install Composer on DreamHost
View dreamhost-php.md

DreamHost PHP

Make PHP 7 default binary for CLI

ssh <server>
View gist:722ca4d79150a031e554a2887a8f9677
/*
* Translated default messages for the jQuery validation plugin.
* Locale: PT_BR
*/
jQuery.extend(jQuery.validator.messages, {
required: "Este campo &eacute; requerido.",
remote: "Por favor, corrija este campo.",
email: "Por favor, forne&ccedil;a um endere&ccedil;o eletr&ocirc;nico v&aacute;lido.",
url: "Por favor, forne&ccedil;a uma URL v&aacute;lida.",
date: "Por favor, forne&ccedil;a uma data v&aacute;lida.",