Skip to content

Instantly share code, notes, and snippets.

View claudiosanches's full-sized avatar
👨‍💻

Claudio Sanches claudiosanches

👨‍💻
View GitHub Profile
@ribeiroevandro
ribeiroevandro / create-site
Last active December 21, 2015 01:08
Script for creating Virtual Servers On Apache
#!/bin/bash
# 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 your-domain.com'
exit 0
fi
@vmassuchetto
vmassuchetto / post_mail.php
Last active December 29, 2015 12:49
Notifies WordPress site admins when some posts are pending for approval
<?php
/**
* Wraps a message $content in a responsive e-mail template.
*
* Reference: http://zurb.com/playground/projects/responsive-email-templates/basic.html
*/
function post_mail_content( $content ) {
ob_start(); ?><html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta content="width=device-width" name="viewport">
@arlm
arlm / bin-cc.md
Last active September 6, 2016 04:15 — forked from erikhenrique/bin-cc.md

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]
@stammy
stammy / Rakefile
Created January 24, 2011 08:01
rake task for creating a new jekyll post.
# ignore the "bit" stuff.. only relevant to my custom jekyll fork
desc 'create new post or bit. args: type (post, bit), title, future (# of days)'
# rake new type=(bit|post) future=0 title="New post title goes here" slug="slug-override-title"
task :new do
require 'rubygems'
require 'chronic'
type = ENV["type"] || "bit"
title = ENV["title"] || "New Title"
@ribeiroevandro
ribeiroevandro / git-notifier
Created June 28, 2013 00:28
Facilitar o trabalho em equipe, usando o GIT como versionador de código.
#!/bin/bash
# Based on https://github.com/maxolasersquad/Git-Notifier/blob/master/gitnotify.sh
declare -A GN_LASTSHOW
GN_DURATION=120
for GN_BRANCH in `git branch -a | grep remotes/origin/master | sed 's/ -> .*//' | sed 's/^ //'`; do
GN_BRANCH_ARRAY=`echo ${GN_BRANCH} | sed 's/\//_/g'`
@dnaber-de
dnaber-de / editor_plugin.js
Created January 22, 2012 18:33
Wordpress TinyMCE Popup-Dialog. German Tutorial on http://dnaber.de/p1477
// js/editor_plugin.js
/**
* an example tinyMCE Plugin
*/
tinymce.create(
'tinymce.plugins.myPlugin',
{
/**
* @param tinymce.Editor editor
* @param string url
@mikejolley
mikejolley / template-stock-report.php
Created December 5, 2011 20:18
WooCommerce - Stock Report. A template page snippet to (if you are logged in as admin) output a list of products/stock (which you are managing stock for) ready for printing.
<?php
/*
Template Name: Stock Report :)
*/
if (!is_user_logged_in() || !current_user_can('manage_options')) wp_die('This page is private.');
?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
@mikejolley
mikejolley / template-print-processing-orders.php
Created November 4, 2011 12:45
WooCommerce - Print Processing orders. A template page snippet to (if you are logged in as admin) output all of your orders with 'processing' status (paid) ready for printing.
<?php
/*
Template Name: Print Processing Orders :)
*/
if (!is_user_logged_in() || !current_user_can('manage_options')) wp_die('This page is private.');
?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
@fdaciuk
fdaciuk / send_mail_post_pending.php
Last active May 12, 2020 23:43
Envia um e-mail para o administrador do site/blog se houver algum post para revisão. PS.: Configurar a conta que receberá o e-mail na variável $email. Por padrão, está configurado o e-mail do administrador do blog.
<?php
/*
Enviar e-mail para o administrador se houver posts para revisão
Dicas do @GugaAlves (@tudoparawp):
- Adicionar link para enviar e-mail diretamente para o administrador;
- Incluir link para a edição do post no admin, facilitando a vida do admin que receber este email.
Dicas do Gustavo Bordoni (@webord):
- incluir na função o $post (objeto para WP_Query) para não ficar passando o $post_id a cada save;
@wolfeidau
wolfeidau / sass_converter.rb
Created May 7, 2011 02:43
Sass plugin for Jekyll
module Jekyll
# Sass plugin to convert .scss to .css
#
# Note: This is configured to use the new css like syntax available in sass.
require 'sass'
class SassConverter < Converter
safe true
priority :low
def matches(ext)