Skip to content

Instantly share code, notes, and snippets.


Claudio Sanches claudiosanches

Block or report user

Report or block claudiosanches

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
SanderTheDragon /
Last active Feb 10, 2020
A shellscript to create a Postman .deb file, for simple installation on Debian-based Linux distro's. Also creates a .desktop file.
ls Postman*.tar.gz > /dev/null 2>&1
if [ $? -eq 0 ]; then
echo "Removing old Postman tarballs"
rm -f $(ls Postman*.tar.gz)
curlExists=$(command -v curl)
mikejolley / ipn-test.php
Last active Jan 2, 2019
Quick snippet/plugin/dropin to test IPN support
View ipn-test.php
* Plugin Name: PayPal Sandbox IPN Tester
* Description: Pings the IPN endpoint to see if your server can connect. Just head to <a href="/?ipn-test=1"></a> whilst logged in as admin.
* Version: 1.0.0
* Author: WooThemes
* Requires at least: 4.1
* Tested up to: 4.3
if ( ! defined( 'ABSPATH' ) ) {
fdemiramon / pre-commit
Created May 12, 2015
Pre-commit hook for git with phpcs and phpcbf (auto-correct obvious violations)
View pre-commit
PROJECT=`php -r "echo dirname(dirname(dirname(realpath('$0'))));"`
STAGED_FILES_CMD=`git diff --cached --name-only --diff-filter=ACMR HEAD | grep \\\\.php`
# Determine if a file list is passed
if [ "$#" -eq 1 ]
ImJasonH / markdown.css
Last active Feb 15, 2020
Render Markdown as unrendered Markdown (see
View markdown.css
* {
font-size: 12pt;
font-family: monospace;
font-weight: normal;
font-style: normal;
text-decoration: none;
color: black;
cursor: default;

Validação para cartão de crédito.

Bin e padrões para validação de cartão de crédito.

Bandeira Começa com Máximo de número Máximo de número cvc Regex
Visa 4 13,16 3 ^4[0-9]{12}(?:[0-9]{3})
Mastercard 5 16 3 ^5[1-5][0-9]{14}
Diners 301,305,36,38 link 14,16 3 ^3(?:0[0-5]&#124;[68][0-9])[0-9]{11}
JedWatson / keystone.js
Created Feb 24, 2014
Example of how to integrate node-i18n with a KeystoneJS app (using yo keystone generated site as a basis) - see for more docs.
View keystone.js
// Simulate config options from your production environment by
// customising the .env file in your project's root folder.
// Require keystone and i18n
var keystone = require('keystone'),
i18n= require('i18n');
// Initialise Keystone with your project's configuration.
// See for available options
kloon / functions.php
Last active Jul 17, 2017
WooCommerce 2.1 variation price, revert to 2.0 format
View functions.php
* Use WC 2.0 variable price format, now include sale price strikeout
* @param string $price
* @param object $product
* @return string
function wc_wc20_variation_price_format( $price, $product ) {
// Main Price
$prices = array( $product->get_variation_price( 'min', true ), $product->get_variation_price( 'max', true ) );
vmassuchetto / post_mail.php
Last active Dec 29, 2015
Notifies WordPress site admins when some posts are pending for approval
View post_mail.php
* Wraps a message $content in a responsive e-mail template.
* Reference:
function post_mail_content( $content ) {
ob_start(); ?><html xmlns=""><head>
<meta content="width=device-width" name="viewport">
adamstac / gist:7441659
Last active Dec 3, 2019
Remove Sendmail from Ubuntu
View gist:7441659

Remove Sendmail from Ubuntu

This should help you completely uninstall Sendmail and all that comes with it.

First, stop the service (assuming it's running).

sudo /etc/init.d/sendmail stop

Uninstall sendmail and sendmail-bin

ribeiroevandro / create-site
Last active Dec 21, 2015
Script for creating Virtual Servers On Apache
View create-site
# Script for creating Virtual Servers On Apache
# Check for the correct parameters
if [ $# -eq 0 ]; then
echo 'Você precisa passar o domínio a ser criado como parâmetro'
echo 'Uso: create-site'
exit 0
You can’t perform that action at this time.