using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* @fileoverview Program to free the content in kindle books as plain HTML. | |
* | |
* This is largely based on reverse engineering kindle cloud app | |
* (https://read.amazon.com) to read book data from webSQL. | |
* | |
* Access to kindle library is required to download this book. | |
*/ | |
// The Kindle Compression Module copied from http://read.amazon.com application |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript | |
ES6ValidationInspection | |
JSAccessibilityCheckInspection | |
JSBitwiseOperatorUsageInspection | |
JSCheckFunctionSignaturesInspection | |
JSClosureCompilerSyntaxInspection | |
JSCommentMatchesSignatureInspection | |
JSComparisonWithNaNInspection | |
JSConsecutiveCommasInArrayLiteralInspection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$packer = new zip_packer(); | |
if ($file) { | |
$itemid = $file->get_itemid(); | |
$filepath = $file->get_filepath(); | |
$filelist = $file->list_files($packer); | |
$numberoffiles = 0; | |
foreach ($filelist as $f) { | |
if (!$f->is_directory) { | |
$numberoffiles++; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Should this data be added? | |
apply_filters( "add_{$meta_type}_metadata", null, $object_id, $meta_key, $meta_value, $unique ); | |
// Do something before we add the data | |
do_action( "add_{$meta_type}_meta", $object_id, $meta_key, $_meta_value ); | |
// Do Something after the data has been added | |
do_action( "added_{$meta_type}_meta", $mid, $object_id, $meta_key, $_meta_value ); |