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 | |
class Utils | |
{ | |
public static function init() | |
{ | |
self::header_cleanup(); | |
} | |
public static function header_cleanup() |
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 | |
global $wpdb; | |
// Insert the original post | |
$original = wp_insert_post($array, true); | |
// Insert the translated post | |
$translated = wp_insert_post($array, true); | |
// Make some updates to both translations |
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 | |
class Envato | |
{ | |
protected static $key = ""; | |
protected static $username = ""; | |
public static function verify( $code ) |
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
#!/bin/bash | |
pantheon-terminal -e "peerflix \"$1\" -v --clean" | |
sleep 1 | |
rm -rvf /tmp/torrent-stream/* | |
#Assuming that you're using panthon-terminal and you have installed nodejs and peerflix | |
#Save this file as a script, paste it anywhere, chmod u+x on it. | |
#In your browser click on a magnet link, point it to your new script and voila | |
#NOTE: !!! You can use xterm instead of pantheon-terminal if you like. |
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 | |
class LazyRecursiveMove | |
{ | |
var $files = array(); | |
var $dest = array(); | |
var $from = ""; | |
var $to = ""; | |
function build_move_array( $from , $to, $parent = "" ) |
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 | |
define('APIKEY', 'your-api-key'); | |
$request = file_get_contents('https://www.googleapis.com/webfonts/v1/webfonts?key='. APIKEY); | |
$fh = fopen('list.txt', 'w'); | |
fwrite($fh, $request); | |
fclose($fh); | |
$content = json_decode($request) ; |
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 | |
class sOption { | |
var $field; | |
public function __construct( $name = 'setting', $label = 'Your Setting', $type = 'text', $screen = 'general' ) | |
{ | |
$this->field->name = $name; | |
$this->field->type = $type; | |
$this->field->screen = $screen; |
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 | |
/** | |
* @modified: Zenger | |
* Safe Search and Replace on Database with Serialized Data v2.0.1b | |
* | |
* This script is to solve the problem of doing database search and replace when | |
* developers have only gone and used the non-relational concept of serializing | |
* PHP arrays into single database columns. It will search for all matching | |
* data on the database and change it, even if it's within a serialized PHP | |
* array. |
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"; | |
ob_implicit_flush(true); ob_end_flush(); //Instant output woohooo thx ##php | |
include_once( WP_PLUGIN_DIR . '/sitepress-multilingual-cms/inc/wpml-api.php' ); | |
$serv = new wpdb("root", "password", "user", "localhost"); | |
global $wpdb; | |
set_time_limit(0); | |
define("THUMB_PATH", "http://yoursite.com/img/products/%s/thumbs/%s"); |
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 | |
// Plugin Name: Show Custom Fields Data | |
// Description: This plugin adds a metabox and shows all the custom fields names and data | |
// Author: Zenger | |
// Author URI: http://github.com/Zenger/ | |
// Version: 1.0 | |
function scfd_add_meta_box() | |
{ | |
foreach (get_post_types() as $post_type) |
NewerOlder