Skip to content

Instantly share code, notes, and snippets.

Avatar

Mickael Burguet rundef

View GitHub Profile
@rundef
rundef / merge-nyc-code-coverage-reports.js
Last active Dec 22, 2020
Script to merge multiple nyc/istanbul code coverage json reports into a single html report: http://rundef.com/typescript-code-coverage-istanbul-nyc
View merge-nyc-code-coverage-reports.js
var path = require('path'),
fs = require('fs'),
libCoverage = require('nyc/node_modules/istanbul-lib-coverage'),
libReport = require('nyc/node_modules/istanbul-lib-report'),
reports = require('nyc/node_modules/istanbul-reports');
var rootFolder = __dirname;
var mergeIntoFolder = 'final';
var files = fs.readdirSync(rootFolder);
var mergedCoverageMap = null;
View WordPress Specific Plugin Disable Update
add_filter('http_request_args', 'dm_prevent_update_check', 10, 2);
function dm_prevent_update_check( $r, $url ) {
if (strpos($url, 'http://api.wordpress.org/plugins/update-check/1.1/') === 0 || strpos($url, 'https://api.wordpress.org/plugins/update-check/1.1/') === 0) {
$my_plugin = plugin_basename(__FILE__);
$plugins = json_decode($r['body']['plugins'], true);
if(isset($plugins['plugins'][$my_plugin]))
unset($plugins['plugins'][$my_plugin]);
$k = array_search($my_plugin, $plugins['active']);
if($k !== FALSE)
unset($plugins['active'][$k]);