Skip to content

Instantly share code, notes, and snippets.

View dingo-d's full-sized avatar
🏠
Working from home

Denis Žoljom dingo-d

🏠
Working from home
View GitHub Profile
@dingo-d
dingo-d / .eslintrc
Created March 16, 2017 07:35
Full WordPress coding standard lint rules - includes style guide recommendations and error checks
{
"root": true,
"globals": {
"_": false,
"$": false,
"Backbone": false,
"JSON": false,
"jQuery": false,
"wp": false
},
@dingo-d
dingo-d / PHP Class
Last active August 5, 2020 07:56
PHPStorm PHP class file templates (class, trait and interfaces). To modify go to Settings > Editor > File and Code Templates
<?php
/**
* File holding ${NAME} class
*
#if (${NAMESPACE}) * @package ${NAMESPACE}
#end
* @since
*/
@dingo-d
dingo-d / build.log
Created July 21, 2020 08:23
The build log for phpbrew mbstring extension /Users/denis.zoljom/.phpbrew/build/php-7.4.7/ext/mbstring/build.log
Configuring for:
PHP Api Version: 20190902
Zend Module Api No: 20190902
Zend Extension Api No: 320190902
checking for grep that handles long lines and -e... /usr/local/bin/ggrep
checking for egrep... /usr/local/bin/ggrep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for pkg-config... /usr/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for cc... cc
@dingo-d
dingo-d / gist:d72fd01e69b73be99fad267796c03410
Created July 20, 2020 18:56
Installing extensions using phpbrew
phpbrew ext install github:php-amqp/php-amqp
This file has been truncated, but you can view the full file.
<html><head><meta http-equiv="Content-Type" content="text/html;charset=utf-8"><meta name="author" content="JetBrains"><script type="text/javascript" src="script.js"></script><link rel="stylesheet" type="text/css" href="styles.css"/><title>PhpStorm inspection report</title></head><body><h3>PhpStorm inspection report:</h3><div style="width:100%;"><div style="float:left; width:50%;"><h4>Inspection tree:</h4><li><label for="174171066"><b>'InspectionViewTree' project</b>&nbsp;<span class="grayout">&nbsp;&nbsp;6&nbsp;errors&nbsp;53&nbsp;warnings&nbsp;127&nbsp;weak&nbsp;warnings&nbsp;477&nbsp;typos&nbsp;</span></label><input type="checkbox" checked onclick="navigate(174171066)" id="174171066" /><ol class="tree"><li><label for="349200440"><b>CSS</b>&nbsp;group&nbsp;<span class="grayout">&nbsp;&nbsp;1&nbsp;warning&nbsp;</span></label><input type="checkbox" onclick="navigate(349200440)" id="349200440" /><ol class="tree"><li><label for="1676378579"><b>Invalid&nbsp;elements</b>&nbsp;group&nbsp;<span class="grayout">&n
@dingo-d
dingo-d / renameTests.php
Created May 25, 2020 12:24
Append Test to test file name script
#!/usr/bin/env php
<?php
function getDirs( $currentDir ) {
return array_filter( $currentDir, function ( $dir ) {
return is_dir( $dir ) && $dir !== '..' && $dir !== '.';
} );
}
@dingo-d
dingo-d / rename.php
Last active May 25, 2020 12:22
Simple php script to rename folder names to PascalCase from split-name. Doesn't go recursively in subfolders.
#!/usr/bin/env php
<?php
function getDirs( $currentDir ) {
return array_filter( $currentDir, function ( $dir ) {
return is_dir( $dir ) && $dir !== '..' && $dir !== '.';
} );
}
@dingo-d
dingo-d / ajax.js
Created April 17, 2020 14:50
Download users from WordPress admin
export const ajaxFetch = (options, resolve, reject) => $.ajax(options)
.done(resolve)
.fail(reject);
@dingo-d
dingo-d / extract-versions.sh
Created April 7, 2020 12:01
A simple shell command script to extract packages and their versions from Gutenberg WP editor. Once in the 'packages' directory you can run this script
for package in $(ls -1); do echo $package; jq -r .version $package/package.json; done
@dingo-d
dingo-d / simple-vies-check.php
Created October 20, 2016 07:32
AJAX function for checking the VAT number based on country and VAT id
<?php
add_action( 'wp_ajax_simple_vies_check', 'simple_vies_check' );
add_action( 'wp_ajax_nopriv_simple_vies_check', 'simple_vies_check' );
if ( ! function_exists( 'simple_vies_check' ) ) {
/**
* AJAX VIES check function for WooCommerce checkout
*
* @since 1.0.0