Skip to content

Instantly share code, notes, and snippets.

View plowzzer's full-sized avatar
🏠
Working from home

Pedro Pizzo de Paula plowzzer

🏠
Working from home
View GitHub Profile
<?php
namespace App\Http\Middleware;
use Closure;
class Cors
{
/**
* Handle an incoming request.
TWITTER:
<a href="http://twitter.com/home/?status=<?php the_title(); ?> - <?php the_permalink(); ?>" title="Tweet this!"></a>
FACEBOOK:
<a href="http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&amp;t=<?php the_title(); ?>" title="Share on Facebook."></a>
REDDIT:
<a href="http://www.reddit.com/submit?url=<?php the_permalink(); ?>&amp;title=<?php the_title(); ?>" title="Vote on Reddit"></a>
STUMBLEUPON:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
/* Máscaras ER */
function mascara(o,f){
v_obj=o
v_fun=f
setTimeout("execmascara()",1)
}
function execmascara(){
v_obj.value=v_fun(v_obj.value)
}
function mtel(v){
@plowzzer
plowzzer / navigation_menu_active.php
Last active September 9, 2016 17:16
Post Type Menu "active"
add_action('nav_menu_css_class', 'add_current_nav_class', 10, 2 );
function add_current_nav_class($classes, $item) {
// Getting the current post details
global $post;
// Getting the post type of the current post
$current_post_type = get_post_type_object(get_post_type($post->ID));
$current_post_type_slug = $current_post_type->rewrite[slug];
@plowzzer
plowzzer / breadcrumbs.php
Created July 28, 2016 03:39
Breadcrumbs in Wordpress
<?// Breadcrumbs
function my_breadcrumbs() {
// Settings
$separator = '<i class="fa fa-angle-right" aria-hidden="true"></i>';
$breadcrums_id = 'breadcrumbs';
$breadcrums_class = 'breadcrumbs';
$home_title = 'Início';
// If you have any custom post types with custom taxonomies, put the taxonomy name below (e.g. product_cat)
@plowzzer
plowzzer / slack_delete.rb
Created April 15, 2016 17:43 — forked from jamescmartinez/slack_delete.rb
This Ruby script will bulk remove all Slack files older than 30 days. Just add your API token from https://api.slack.com/web#authentication into the token quotes at the top of the file.
require 'net/http'
require 'json'
require 'uri'
@token = ''
def list_files
ts_to = (Time.now - 30 * 24 * 60 * 60).to_i # 30 days ago
params = {
token: @token,