Skip to content

Instantly share code, notes, and snippets.

View pixline's full-sized avatar

Paolo T. pixline

View GitHub Profile
@pixline
pixline / .scrutinizer.yml
Created September 28, 2013 17:22
sample scrutinizer.yml config file for WordPress plugin
filter:
paths:
- 'lib/*'
- '/*'
excluded_paths:
- 'tests/*'
- 'examples/*'
tools:
php_mess_detector:
filter:
{
"name": "progetto",
"version": "1.0.0",
"devDependencies": {
"grunt": "~0.4.0",
}
}
@pixline
pixline / liquidsoap-homebrew.log
Created August 3, 2013 00:38
homebrew liquidsoap build fail log
1 pixline@white ~ % brew install liquidsoap :(
==> Installing liquidsoap dependency: objective-caml
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/objective-caml-4.00.1.lion.bottle.1.tar.gz
######################################################################## 100,0%
==> Pouring objective-caml-4.00.1.lion.bottle.1.tar.gz
🍺 /usr/local/Cellar/objective-caml/4.00.1: 1191 files, 210M
==> Installing liquidsoap dependency: ocaml-findlib
==> Downloading http://download.camlcity.org/download/findlib-1.3.3.tar.gz
######################################################################## 100,0%
Warning: MD5 support is deprecated and will be removed in a future version.
#!/usr/bin/env bash
# args
MSG=${1-'deploy from git'}
BRANCH=${2-'trunk'}
# paths
SRC_DIR=$(git rev-parse --show-toplevel)
DIR_NAME=$(basename $SRC_DIR)
DEST_DIR=~/svn/$DIR_NAME/$BRANCH
@pixline
pixline / test-raw.php
Last active December 19, 2015 20:49
Differences on exif_read_data() between raw PHP and WordPress 'wp_handle_upload_prefilter' filter. Raw PHP call will return $exif['Make'] and $exif['Model'] while WordPress filtered upload will set $exif['IFD0']['Make'] and $exif['IFD0']['Model']
<?php
print_r( exif_read_data( 'sucuri-test.jpg' ) );
/*
Array
(
[FileName] => sucuri-test.jpg
[FileDateTime] => 1374009774
[FileSize] => 38936
[FileType] => 2
@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
@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 / 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 / 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