Skip to content

Instantly share code, notes, and snippets.

@pepe84
pepe84 / polylang-sync-rate-my-post.php
Last active September 7, 2022 16:46 — forked from Tyxz/polylang-sync-rate-my-post.php
Sync the ratings of the Wordpress plugin "rate-my-post" with all polylang translated variants of it.
<?php
/**
* @package polylang-sync-rate-my-post
*/
/*
Plugin Name: polylang-sync-rate-my-post
Plugin URI: https://gist.github.com/Tyxz/09ea3d4b205738be2a8b2b777892b62a
Description: Sync the ratings of the Wordpress plugin "rate-my-post" with all polylang translated variants of it.
Version: 0.1
Author: Arne Rantzen
#!/usr/bin/python
# https://docs.python.org/3/howto/argparse.html
# https://pythonspot.com/reading-csv-files-in-python/
# https://www.tutorialspoint.com/python/python_database_access.htm
# https://mysqlserverteam.com/how-to-create-multiple-accounts-for-an-app/
import argparse
import csv
import MySQLdb
# Get script arguments
@pepe84
pepe84 / iso_date.js
Created November 17, 2011 13:27
JavaScript ISO 8601 date
/**
* ISO 8601 date
* @see http://webcloud.se/log/JavaScript-and-ISO-8601/
* @example "2008-07-09T16:13:30+12:00"
*/
function IsoDate() {};
// Date inheritance
@pepe84
pepe84 / Bootstrap.php
Created August 26, 2011 10:34 — forked from drslump/Bootstrap.php
PHP Zend: Resources lazy loading
<?php
/**
* Resources lazy loading
*
* @category Zend
* @package Zend_Application
* @subpackage Bootstrap
* @version $Id$
*/
@pepe84
pepe84 / Multilog.php
Created August 26, 2011 08:22
PHP Zend: Multilog resource
<?php
require_once 'Zend/Application/Resource/ResourceAbstract.php';
require_once 'Zend/Log.php';
/**
* Multilog Resource
*
* @category Zend
* @package Zend_Application
@pepe84
pepe84 / Bootstrap.php
Created July 25, 2011 09:30
PHP Zend: My SoapClient resource
<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
/**
* Initialize SoapClient
*/
public function _initMySoapClient()
{
$options = $this->getOptions();
@pepe84
pepe84 / App_Zend_Application_Resource_Acl.php
Created July 18, 2011 11:30
PHP Zend: Zend ACL extended
<?php
class App_Zend_Application_Resource_Acl
extends Zend_Application_Resource_ResourceAbstract
{
/** @var Zend_Acl **/
protected $_acl = null;
/** @var string **/
protected $_wildcard = '*';
@pepe84
pepe84 / Modules.php
Created July 14, 2011 08:49
PHP Zend: Modules bootstrap
<?php
/**
* Plugin to automatically init modules configuration
*
* @category Zend
* @package Zend_Controller
* @subpackage Plugin
* @author Jose Luis Jiménez Castelltort <jljc.work@gmail.com>
* @version $Id$
*/
@pepe84
pepe84 / App.php
Created July 4, 2011 09:57
PHP Zend: Resources lazy loading
<?php
class App
{
/** @var Zend_Application */
static protected $_application;
public function __construct()
{
// Using INI