Skip to content

Instantly share code, notes, and snippets.

Avatar

Nate Wright NateWr

View GitHub Profile
@NateWr
NateWr / JATS-editor-tags.md
Created Sep 21, 2020
JATS tags that a web-based editor deployed with PKP applications should support.
View JATS-editor-tags.md

JATS Editor Tag Support

This document describes the JATS tags that should be supported by a web-based editor in PKP applications. This is a limited set of JATS tags that PKP considers valuable for writing and publishing full-text articles online using OJS.

The tags described here are those that are necessary for generating the full text of an article. It does not include tags related to frontmatter or backmatter that are not used in the article body, and which can be generated from OJS's existing metadata features.

MVP

The following tags are necessary for most of our community to be able to use the editor. The goal is to achieve parity with something like a regular HTML rich-text editor, such as TinyMCE, by supporting text, tables and images.

@NateWr
NateWr / constants.php
Created Jul 8, 2020
A CLI tool for OJS/OMP/OPS to get the value of application constants.
View constants.php
<?php
/**
* @file tools/constants.php
*
* Copyright (c) 2014-2020 Simon Fraser University
* Copyright (c) 2003-2020 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @class constants
@NateWr
NateWr / removeLocaleKey.php
Last active Jun 22, 2020
A tool for OJS|OMP|OPS to remove a locale key from every locale.
View removeLocaleKey.php
// This has been added to the main repositories for OJS, OMP and OPS. Run the following CLI command:
//
// php lib/pkp/tools/removeLocaleKey.php locale.key
@NateWr
NateWr / comment-blacklist-for-rtb.php
Last active Aug 6, 2019
Check new bookings for blacklisted words in comments for Restaurant Reservations
View comment-blacklist-for-rtb.php
<?php
/**
* Plugin Name: Comment Blacklist for Restaurant Reservations
* Plugin URI: http://themeofthecrop.com
* Description: Check if a booking includes blacklisted words from Settings > Discussion > Comment Blacklist before accepting it.
* Version: 1.0
* Author: Theme of the Crop
* Author URI: http://themeofthecrop.com
* License: GNU General Public License v2.0 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
@NateWr
NateWr / remove-publishing-mode.php
Last active May 7, 2019
Remove the publishingMode setting from the access form for everyone except the site admin.
View remove-publishing-mode.php
<?php
/**
* Remove the publishingMode setting from the access form for
* everyone except the site admin
*/
HookRegistry::register('Form::config::before', function ($hookName, $form) {
if (!defined('FORM_ACCESS') || $form->id !== FORM_ACCESS) {
return;
}
if (/* user is not an admin */) {
@NateWr
NateWr / block-publishing-mode.php
Created May 7, 2019
Block requests to change the publishingMode setting from anyone except the site admin.
View block-publishing-mode.php
<?php
/**
* Refuse requests to change the publishingMode setting from anyone
* except the site admin.
*/
HookRegistry::register('Context::validate', function($hookName, $args) {
$errors &= $args[0];
$props &=$args[2];
if (/* user is not an admin */) {
View js2_test.md

What is the value result in these code snippets

// 1
var writerAge = 10
var result = writerAge + 5
20
// 2
@NateWr
NateWr / GenerateMetrics.php
Last active Jun 22, 2020
A CLI tool to generate fake metrics data.
View GenerateMetrics.php
// This tool is now available in the main development repositories for OJS, OMP and OPS.
// Run the following command from the root directory of any application to get usage
// instructions.
//
// php lib/pkp/tools/generateTestMetrics.php
@NateWr
NateWr / date-time-template-tags-for-rtb.php
Created Apr 10, 2019
Add separate template tags for the date and time of the booking request.
View date-time-template-tags-for-rtb.php
<?php
/**
* Plugin Name: Date and Time Template Tags for Restaurant Reservations
* Plugin URI: http://themeofthecrop.com
* Description: Add separate template tags for the date and time of the booking request.
* Version: 0.0.1
* Author: Theme of the Crop
* Author URI: http://themeofthecrop.com
* License: GNU General Public License v2.0 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
@NateWr
NateWr / email-templates-for-rtb-logo-size.php
Created Mar 5, 2019
Use a custom logo size for the email templates addon for Restaurant Reservations.
View email-templates-for-rtb-logo-size.php
<?php
/**
* Plugin Name: Custom Logo Size for Email Templates for Restaurant Reservations
* Plugin URI: http://themeofthecrop.com
* Description: Use a custom logo size for the email templates addon for Restaurant Reservations.
* Version: 1.0
* Author: Theme of the Crop
* Author URI: http://themeofthecrop.com
* License: GNU General Public License v2.0 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
You can’t perform that action at this time.