Skip to content

Instantly share code, notes, and snippets.

View glebkema's full-sized avatar

Gleb Kemarsky glebkema

View GitHub Profile
@glebkema
glebkema / rscsvimporter-debug.php
Last active October 19, 2019 06:03 — forked from hissy/rscsvimporter-debug.php
Really Simple CSV Importer Debugger add-on
<?php
/*
Plugin Name: Really Simple CSV Importer Debugger add-on
Description: Enables to dry-run-testing with Really Simple CSV Importer. When this add-on plugin activated, csv data will not imported, just displayed on dashboard.
Author: Takuro Hishikawa
Version: 0.2.1
*/
class rscsvimporter_debug {
// singleton instance
@glebkema
glebkema / encrypt_expiration_time_by_affine.php
Last active June 4, 2020 10:27
Encrypt and decrypt all digits in the expiration time by the Affine cipher
<?php
// Answer for https://www.gutefrage.net/frage/wie-kann-man-einen-php-token-generator-machen#answer-352860809
// Encrypt and decrypt all digits in the expiration time by the Affine cipher
// https://en.wikipedia.org/wiki/Affine_cipher
// https://stackoverflow.com/a/23679870/6263942
// encypt and decrypt the digit by the Affine cipher
function encrypt_digit( $digit ) {
return ( 7 * $digit ) % 10;