This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// This is the script I used to export my old blog out of WordPress and into a | |
// Jekyll friendly format. The first half exports posts, the second does pages. | |
// It's fairly specific to my needs, but maybe it'll be a good starting point | |
// for you. /RTH 2011-08-28 | |
// https://twitter.com/#!/marcoarment/status/59089853433921537 | |
date_default_timezone_set('America/Los_Angeles'); | |
$db = mysql_connect('host', 'username', 'pass') or die(mysql_error()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
header('Access-Control-Allow-Origin: *'); | |
header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept'); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$headers = "MIME-Version: 1.0\r\n"; | |
$headers .= 'From: ' . get_bloginfo('admin_email') . "\r\n"; | |
$headers .= "Content-Type: text/html; charset=\"" . get_option('blog_charset') . "\"\n"; | |
$receiver = get_user_by('id', $receiver_id); | |
$giver = get_user_by('id', $giver_id); | |
$to = $receiver->user_email; | |
$subject = 'Subject'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'wp-load.php'; | |
$wp_roles = new WP_Roles(); | |
$wp_roles->remove_role("YOUR_ROLE"); // author, editor, contributor | |
$names = $wp_roles->get_names(); | |
print_r($names); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
echo '<h1>DirectAdmin</h1>'; | |
echo '<i>php -q /home/DIRECTADMIN_USERNAME/domains/DOMAIN/public_html/wp-cron.php</i>'; | |
echo '<hr>'; | |
echo '<h1>cPanel</h1>'; | |
echo '<i>php -q /home/CPANEL_USERNAME/public_html/wp-cron.php</i>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Change select box options based on value from another select box | |
$(document).ready(function(){ | |
// If the user select a value from the select | |
$('#FIRST_SELECT').change(function(){ | |
// Get the selected value | |
var get_eveniment = $(this).val(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
title SVN Client v1.0 | |
echo #################################### | |
echo ## ## | |
echo ## Welcome to the SVN Client v1.0 ## | |
echo ## ## | |
echo #################################### | |
cd C:\Program Files\SlikSvn\bin\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Get coordinates for a specified address | |
function getCoordinates($address){ | |
$address = str_replace(" ", "+", $address); // replcae all the white space with "+" sign to match with google search pattern | |
$url = "http://maps.google.com/maps/api/geocode/json?sensor=false&address=$address"; | |
$response = file_get_contents($url); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('post_type_link','custom_post_type_link',10,3); | |
function custom_post_type_link($permalink, $post, $leavename) { | |
$url_components = parse_url($permalink); | |
$post_path = $url_components['path']; | |
$post_name = end(explode('/', trim($post_path, '/'))); | |
if(!empty($post_name)) { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// HOW TO USE: | |
// Simply type in the url in the text box to reset the WordPress site url. | |
// WARNING: | |
// This file can be a HUGE security risk and has the potential to seriously | |
// mess up your site's database. Please use with caution and DELETE THIS FILE when you | |
// are done resetting your website. | |
OlderNewer