Skip to content

Instantly share code, notes, and snippets.

View viniciusbig's full-sized avatar

Vinicius Arantes viniciusbig

  • CI&T
  • Campinas - SP - Brazil
View GitHub Profile
@viniciusbig
viniciusbig / 20220607135049_RemoveUsernameFromUsers.php
Created January 18, 2023 14:19
CakePHP Migration to remove Username in the login process -
<?php
declare(strict_types=1);
use Migrations\AbstractMigration;
class RemoveUsernameFromUsers extends AbstractMigration
{
/**
* Up Method.
*
@viniciusbig
viniciusbig / trakt.php
Created May 8, 2022 18:47
A simple PHP class for accessing the Trakt API
<?php
/**
* A simple class for accessing the Trakt API. You can use it like so:
*
* $trakt = new Trakt("You API Key");
* $trakt->showSeasons("The Walking Dead", true);
*
* You can view the list of available API methods here: http://trakt.tv/api-docs
* To call a method, such as "search/movies", the ``Trakt`` class will respond
* to the corresponding method name "searchMovies". So, in the above example, the
@viniciusbig
viniciusbig / get-comments.js
Created September 11, 2020 18:41
Chrome snippet to get HTML comments with jQuery
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 September 11, 2020 18:39
Chrome Snipet to save console log into files
(function(console){
console.save = function(data, filename){
if(!data) {
console.error('Console.save: No data')
return;
}
if(!filename) filename = 'console.json'
@viniciusbig
viniciusbig / sync-forks-repos.sh
Last active September 11, 2020 12:54
Sync Forks with all branches and tags
# 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 / pagespeed_optimize_images.sh
Created June 19, 2020 14:17 — 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 )
#!/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 23:51 — forked from dansku/dropboxOrganize.py
Script to organize pictures uploaded from Mobile Devices to Dropbox's Camera Upload folder
################################################################################################
#
# 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 October 24, 2019 17:03 — forked from pauloiankoski/frete-gratis.txt
Frete grátis por região no WooCommerce
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 September 20, 2019 18:34 — forked from ethicka/wp-start.sh
WordPress Installation with the Roots/Sage Framework and VirtualHost Creation
#!/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 September 4, 2019 17:26 — forked from ercoppa/80-keychron.rules
K2 Keychron Ubuntu 18.04
SUBSYSTEMS=="input", ATTRS{name}=="Keychron K2", RUN+="/bin/sh -c 'echo 0 > /sys/module/hid_apple/parameters/fnmode'"