Skip to content

Instantly share code, notes, and snippets.

View rudwolf's full-sized avatar

rudwolf

View GitHub Profile
@rudwolf
rudwolf / Sublime Text 3 Build 3103 License Key - CRACK
Created May 2, 2017 18:35
Sublime Text 3 Build 3103 License Key - CRACK
I use the first
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
@rudwolf
rudwolf / category-archive.php
Created July 14, 2016 17:57
Get the archive for specific category
<?php
global $wpdb, $wp_locale;
$query = "SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts, $wpdb->term_taxonomy, $wpdb->term_relationships
WHERE $wpdb->posts.post_status = 'publish'
AND $wpdb->posts.post_type = 'post'
AND $wpdb->term_taxonomy.term_id = 11
AND $wpdb->posts.ID = $wpdb->term_relationships.object_id
AND $wpdb->term_taxonomy.term_taxonomy_id = $wpdb->term_relationships.term_taxonomy_id
GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date DESC";
@rudwolf
rudwolf / estados.php
Last active August 10, 2016 17:55
Array associativa de estados brasileiros com sigla pra chave e nome para valor para uso em PHP
<?php
$estados = array(
"AC"=>"Acre",
"AL"=>"Alagoas",
"AM"=>"Amazonas",
"AP"=>"Amapá",
"BA"=>"Bahia",
"CE"=>"Ceará",
"DF"=>"Distrito Federal",
"ES"=>"Espírito Santo",
@rudwolf
rudwolf / zip.php
Created November 19, 2015 15:47 — forked from jonmaim/zip.php
PHP script to remotely create zip archives of your FTP
<?php
/*
*
* This script will backup your web site by remotely archiving all files on the root FTP directory.
* It will work even if your web server is memory limited buy splitting zips in several arhive files it they are too many files.
* All zip files will be stored in a directory called temporary which must be writable.
*
* How to use it:
* - Place the script at the root of your FTP.
@rudwolf
rudwolf / wpse_70758.php
Last active August 29, 2015 14:26 — forked from brasofilo/wpse_70758.php
WordPress plugin : Prevent Categories Deletion
<?php
/*
Plugin Name: Prevent Category Deletion
Plugin URI: http://wordpress.stackexchange.com/q/70758/12615
Description: Prevent deletion of categories. Modify the $undeletable array to suit your setup. Use Category SLUGS.
Author: brasofilo
Version: 1.0
Author URI: http://wordpress.stackexchange.com/users/12615/brasofilo
*/