Skip to content

Instantly share code, notes, and snippets.

View eduardopintor's full-sized avatar

Eduardo Pintor eduardopintor

View GitHub Profile
@eduardopintor
eduardopintor / .htaccess
Last active August 29, 2015 14:18
WordPress Security .htaccess
# Rules to disable directory browsing
Options -Indexes
# BEGIN Ban Users
# Begin HackRepair.com Blacklist
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} ^[Ww]eb[Bb]andit [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^Acunetix [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^binlar [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ^BlackWidow [NC,OR]
@eduardopintor
eduardopintor / wordpress-plugins
Created April 8, 2015 01:20
WordPress Plugin List
Antispam Bee
Autoptimize
BackWPup
Contact Form 7
Cookies for Comments
EWWW Image Optimizer
FV Top Level Categories
Twitter Widget Pro
WordPress Importer
WordPress SEO
<?php
/**
* Custom WordPress configurations on "wp-config.php" file.
*
* This file has the following configurations: MySQL settings, Table Prefix, Secret Keys, WordPress Language, ABSPATH and more.
* For more information visit {@link https://codex.wordpress.org/Editing_wp-config.php Editing wp-config.php} Codex page.
* Created using {@link http://generatewp.com/wp-config/ wp-config.php File Generator} on GenerateWP.com.
*
* @package WordPress
* @generator GenerateWP.com
@eduardopintor
eduardopintor / 01_Laravel 5 Simple ACL manager_Readme.md
Created May 8, 2016 17:28 — forked from amochohan/01_Laravel 5 Simple ACL manager_Readme.md
Laravel 5 Simple ACL - Protect routes by an account / role type

#Laravel 5 Simple ACL manager

Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.

If the user has a 'Root' role, then they can perform any actions.

Installation

Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php

@eduardopintor
eduardopintor / countries.sql
Created June 6, 2016 15:28 — forked from adhipg/countries.sql
Sql dump of all the Countries, Country Codes, Phone codes.
CREATE TABLE IF NOT EXISTS `country` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`iso` char(2) NOT NULL,
`name` varchar(80) NOT NULL,
`nicename` varchar(80) NOT NULL,
`iso3` char(3) DEFAULT NULL,
`numcode` smallint(6) DEFAULT NULL,
`phonecode` int(5) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE table1;
SET FOREIGN_KEY_CHECKS = 1;
@eduardopintor
eduardopintor / README.md
Last active August 19, 2016 20:11
Deploy automático com Bitbucket

#Preparando ambiente

Primeiramente você precisará da chave pública do seu servidor para poder se comunicar com o Bitbucket usando SSH sem senha. Esta chave geralmente fica no caminho:

/home/user/.ssh/id_rsa.pub

Caso a pasta .ssh não exista no diretório home do usuário, basta executar o comando ssh-keygen. Copie o conteúdo do arquivo id_rsa.pub e adicione no seu repositório em Settings > Deployment Keys.

#Clonando repositório

@eduardopintor
eduardopintor / README.md
Created August 29, 2016 22:02 — forked from oodavid/README.md
Backup MySQL to Amazon S3

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc

@eduardopintor
eduardopintor / gist:fec999ca2a34296038692852aac84349
Created November 23, 2016 17:49 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@eduardopintor
eduardopintor / functions.php
Created December 24, 2016 21:32
Filter Wordpress Posts by User Meta (Custom Post Type Taxonomy)
add_filter( 'posts_where' , 'me_posts_where' );
function me_posts_where( $where ) {
if( is_admin() ) {
global $wpdb;
// Get Current Page
global $pagenow;
// Get Current Logged In User
global $current_user;