Skip to content

Instantly share code, notes, and snippets.

View jrfnl's full-sized avatar
🐘
Herding 🐘

Juliette jrfnl

🐘
Herding 🐘
View GitHub Profile
@jrfnl
jrfnl / wp-survey-and-quiz-tool-nl_NL.po
Created September 13, 2012 17:33
Dutch translation file for WP Survey and Quiz Tool
# Copyright (C) 2012 WP Survey And Quiz Tool
# This file is distributed under the same license as the WP Survey And Quiz Tool package.
msgid ""
msgstr ""
"Project-Id-Version: WP Survey And Quiz Tool 2.11\n"
"Report-Msgid-Bugs-To: http://wordpress.org/tag/wp-survey-and-quiz-tool\n"
"POT-Creation-Date: 2012-09-13 13:15:40+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
@jrfnl
jrfnl / wp-config-debug.php
Last active April 5, 2024 18:16
Code to add to wp-config.php to enhance information available for debugging.
<?php
/**
* == About this Gist ==
*
* Code to add to wp-config.php to enhance information available for debugging.
*
* You would typically add this code below the database, language and salt settings
*
* Oh.. and *do* make sure you change the path to the log file to a proper file path on your server (make sure it exists).
*
# .htaccess voor /path/to/writable/file/logs/
IndexIgnore *
# Don't show directory listings for URLs which map to a directory.
Options All -Indexes
Options +FollowSymLinks
#Refuse access to this directory to all
Order Allow,Deny
@jrfnl
jrfnl / ShortcodeReference.php
Last active December 31, 2015 23:59
Debugged version of the ShortcodeReference.php file from @bartee's WP plugin Shortcode Reference. Not all the fixes are done in the most efficient way, but at least it (sort of) works now and definitely works better than before.
<?php
/**
* DataContainer for shortcodes.
*
* @author Bart Stroeken
*/
class ShortcodeReference {
/**
* Shortcode
@jrfnl
jrfnl / bccalc.php
Last active October 17, 2019 01:13
Do simple reliable math calculations without the risk of wrong results using bcmath
<?php
/**
* Do simple reliable floating point calculations without the risk of wrong results.
*
* @see http://floating-point-gui.de/
* @see the big red warning on http://php.net/language.types.float.php
*
* In the rare case that the bcmath extension would not be loaded, it will return the
* normal calculation results.
*
@jrfnl
jrfnl / functions-add-icons.php
Created May 26, 2014 19:30
Easily add favicon and apple touch and Windows8 icons to the html page header of a WordPress website
<?php
/**
* Add favicon and apple touch and Windows8 icons to the html page header of a WordPress website
*
* Add the favicon link properly to the page header so it will work in all browsers
* Add apple touch icons
* Add the Windows8 icons
* Presumes you will add the icons in the theme directory in a subfolder '/images/icons/'
* - adjust if you use another folder.
@jrfnl
jrfnl / _readme.md
Last active June 4, 2023 17:12
PHPUnit xslt

###PHPUnit logfile XLST template

This fileset provides an easy way to view the PHPUnit XML (JUnit) logfiles in a human readable manner using a web browser.

Use this either in combination with the accompanying html file or add the following tag straight after the xml opening tag of the logfile: <?xml-stylesheet type="text/xsl" href="phpunit.xslt"?>

The thresholds used for the colour-coding and whether or not to show detail for successfull tests can be changed by adjusting the variables at the top of the xslt file.

@jrfnl
jrfnl / contributors.html
Last active July 1, 2016 18:01
GitHub Pages Jekyll/Liquid snippet to display repo contributors.
<div class="contributors">
{% for contributor in site.github.contributors %}
[![Avatar]({{ contributor.avatar_url }}){: style="width: 30px;"}]({{ contributor.html_url }}) [@{{ contributor.login }}]({{ contributor.html_url }})
{: .contributor }
{% else %}
This project would not be possible without the help of [our amazing contributors] on GitHub.
{% endfor %}
</div>
_____Issue Title____
[New sniff] Short rule description (for rules which have to be created from scratch)
[Implement sniff] Short rule description (for rules which exist in WPCS and need to be added to the ruleset)
_____Issue Content____
#### Rule type:
Error / Warning
#### Rule:
@jrfnl
jrfnl / 20180611-phpcs-run-src-only-i18n-translatorscomments.txt
Created June 13, 2018 10:39
201806 WCEU list of translator comments issues in WP Core
FILE: src\wp-admin\about.php
--------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
--------------------------------------------------------------------------------------------------------------
21 | WARNING | A gettext call containing placeholders was found, but was not accompanied by a "translators:"
| | comment on the line above to clarify the meaning of the placeholders.
| | (WordPress.WP.I18n.MissingTranslatorsComment)
23 | WARNING | A gettext call containing placeholders was found, but was not accompanied by a "translators:"
| | comment on the line above to clarify the meaning of the placeholders.
| | (WordPress.WP.I18n.MissingTranslatorsComment)