Skip to content

Instantly share code, notes, and snippets.

View pixline's full-sized avatar

Paolo T. pixline

View GitHub Profile
@pixline
pixline / multilanguage.json
Created February 25, 2014 19:17
WP pods light multilanguage prototype
{"meta":{"version":"2.3.18","build":1393355830},"pods":{"21":{"id":21,"name":"language","label":"Languages","description":"","type":"taxonomy","storage":"none","object":"","alias":"","fields":[],"show_in_menu":1,"label_singular":"Language","public":"1","show_ui":"1","hierarchical":"0","rewrite":"1","rewrite_with_front":"1","rewrite_hierarchical":"1","query_var":"1","sort":"0","built_in_post_types_page":"1","built_in_post_types_post":"1","built_in_post_types_attachment":"0","menu_location":"default","menu_position":"0","show_in_nav_menus":"1","show_tagcloud":"1","show_admin_column":"1"},"23":{"id":23,"name":"post","label":"Post","description":"","type":"post_type","storage":"meta","object":"post","alias":"","fields":{"post_language":{"id":24,"name":"post_language","label":"Language","description":"","help":"","class":"","type":"pick","weight":0,"pick_object":"taxonomy","pick_val":"language","sister_id":"","required":"1","pick_format_type":"single","pick_format_single":"dropdown","pick_format_multi":"checkbox",
@pixline
pixline / blowfish_hex_test.php
Created October 23, 2011 04:00
Decodifica HEX -> Blowfish -> Plain Text
<?php
/**
* Decodifica HEX -> Blowfish -> Plain Text
* @license http://creativecommons.org/publicdomain/zero/1.0/
*/
/**
* pear install Crypt_Blowfish
* @link http://pear.php.net/package/Crypt_Blowfish/
*/
@pixline
pixline / Makefile
Last active December 15, 2015 15:56
Vagrant project setup Makefile
# Digital Ocean Vagrant Makefile
# Based on https://gist.github.com/avalanche123/1297080
# These values are overwriteable by command line.
AUTHOR = SWERgroup Developers <plugins@swergroup.com>
PROJECT = vagrant
CONFDIR = config
PROVDIR = provision
define license
@pixline
pixline / Gruntfile.js
Created June 27, 2013 01:28
Grunt.js example file
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
{
"name" : "rarst/install-test",
"description" : "Test project for WordPress stack via Composer",
"authors" : [
{
"name" : "Andrey Savchenko",
"email" : "contact@rarst.net",
"homepage": "http://www.Rarst.net/"
}
],
#!/bin/bash
DOMAIN="easyforex"
POT="$DOMAIN.pot"
LANGS="en_US ru_RU"
SOURCES="*.php"
# Create template
echo "Creating POT"
rm -f $POT
@pixline
pixline / reset.sh
Created June 30, 2013 15:10
(sample) post-commit wp-cli local routine
#!/bin/bash
wp db reset --yes
wp core install --url=http://plugins.wp --title="plugin dev" --admin_name=plugins --admin_email=plugins@example.org --admin_password=plugins
wp plugin install <plugin_name> --activate
@pixline
pixline / wpcli-unit-tests-setup-draft.php
Last active December 19, 2015 04:18
(draft) wp-cli theme unit test setup automation
<?php
$download_url = 'https://wpcom-themes.svn.automattic.com/demo/theme-unit-test-data.xml';
$silent = WP_CLI::get_config('quiet') ? '--silent ' : '';
$cmd = "curl -f $silent %s -o /tmp/theme-unit-test-data.xml";
WP_CLI::launch( Utils\esc_cmd( $cmd, $download_url ) );
# reset wp
WP_CLI::launch( 'wp db reset --yes' );
@pixline
pixline / stacktrace.txt
Last active December 19, 2015 06:09
wp-cli early command stack trace
PHP Fatal error: Call to a member function register_early_invoke() on a non-object in /src/wp-cli/php/WP_CLI/Dispatcher/CompositeCommand.php on line 23
PHP Stack trace:
PHP 1. {main}() /src/wp-cli/php/boot-fs.php:0
PHP 2. include() /src/wp-cli/php/boot-fs.php:17
PHP 3. WP_CLI\Utils\load_dependencies() /src/wp-cli/php/wp-cli.php:13
PHP 4. require() /src/wp-cli/php/utils.php:19
PHP 5. ComposerAutoloaderInitf85e7a78598cba3871ca35c635bc35df::getLoader() /src/wp-cli/vendor/autoload.php:7
PHP 6. require() /src/wp-cli/vendor/composer/autoload_real.php:46
PHP 7. WP_CLI::add_command() /src/wp-cli-test-command/wp-cli-test-command.php:72
@pixline
pixline / reset-wp.sh
Created July 5, 2013 22:54
Simple shell dev routine: - reset database - reinstall WP - install theme unit test dataset, plugins and options.
#!/bin/bash
wp db reset --yes
wp core install --url=http://wp35.dev --title="WP" --admin_name=test --admin_email=test@example.org --admin_password=test
wp theme-test install --menus