Skip to content

Instantly share code, notes, and snippets.

@viniciusbig
viniciusbig / get-comments.js
Created Sep 11, 2020
Chrome snippet to get HTML comments with jQuery
View get-comments.js
jQuery.fn.comments = function( blnDeep ){
var blnDeep = (blnDeep || false);
var jComments = $( [] );
// Loop over each node to search its children for
// comment nodes and element nodes (if deep search).
this.each(
function( intI, objNode ){
var objChildNode = objNode.firstChild;
var strParentID = $( this ).attr( "id" );
@viniciusbig
viniciusbig / console.save.js
Created Sep 11, 2020
Chrome Snipet to save console log into files
View console.save.js
(function(console){
console.save = function(data, filename){
if(!data) {
console.error('Console.save: No data')
return;
}
if(!filename) filename = 'console.json'
@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 / sync-forks-repos.sh
Last active Sep 11, 2020
Sync Forks with all branches and tags
View sync-forks-repos.sh
# Create your own fork/copy of the target repository using the FORK button.
# Clone/download it to local machine with…
$ git clone https://github.com/YOUR_USERNAME/REPO_NAME.git
# Check your local copy references
$ git remote -v
origin https://github.com/YOUR_USERNAME/REPO_NAME.git (fetch)
origin https://github.com/YOUR_USERNAME/REPO_NAME.git (push)
@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: "
@viniciusbig
viniciusbig / correios.html
Created Dec 9, 2018
Link direto para a pagina dos correios rastreando encomenda
View correios.html
<form id="shipping-correo" method="POST" target="_blank" action="https://www2.correios.com.br/sistemas/rastreamento/resultado_semcontent.cfm">
<input type="hidden" name="Objetos" value="CODIGODERASTREIO">
<a href="javascript:;" onclick="parentNode.submit();">CODIGODERASTREIO</a>
</form>