View index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Obter identificação do comprador | |
var getSenderHash = function () { | |
console.log('getSenderHash >>>'); | |
PagSeguroDirectPayment.onSenderHashReady(function(response) { | |
if (response.status == 'error') { | |
console.log(response.message); | |
return false; | |
} | |
console.log(response); | |
hashField.val(response.senderHash); |
View gist:f0ffc9db7ca05c0bdba42b5b711a6b03
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Increase or decrease value in CakePHP with little footprint. | |
Add this to your AppModel. | |
Usage: | |
(in Controller) | |
$this->Model->increase('field_name', 1); |
View correios.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
View wp.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 80-keychron.rules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SUBSYSTEMS=="input", ATTRS{name}=="Keychron K2", RUN+="/bin/sh -c 'echo 0 > /sys/module/hid_apple/parameters/fnmode'" |
View wp-start.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
View frete-gratis.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
View sync-forks-repos.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
View dropboxOrganize.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################################################ | |
# | |
# 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 |
View pagespeed_optimize_images.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 {} \; |