Skip to content

Instantly share code, notes, and snippets.

Rotimi Ade rotexdegba

Block or report user

Report or block rotexdegba

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
rotexdegba / rector.yaml
Last active Jan 17, 2020
A yaml file containing base Rector configuration setting to be used by the Rector tool on all my php projects
View rector.yaml
# rector.yaml
# - { resource: 'vendor/rector/rector/config/set/code-quality/code-quality.yaml' }
# - { resource: 'vendor/rector/rector/config/set/php/php52.yaml' }
# - { resource: 'vendor/rector/rector/config/set/php/php53.yaml' }
# - { resource: 'vendor/rector/rector/config/set/php/php54.yaml' }
# - { resource: 'vendor/rector/rector/config/set/php/php55.yaml' }
# - { resource: 'vendor/rector/rector/config/set/php/php56.yaml' }
# - { resource: 'vendor/rector/rector/config/set/php/php70.yaml' }
# - { resource: 'vendor/rector/rector/config/set/php/php71.yaml' }
rotexdegba / html5-input-type-number-2-decimal-places.html
Last active Jul 8, 2019
Html5 Input field for currency to 2 decimal places
View html5-input-type-number-2-decimal-places.html
<!DOCTYPE html>
<title>TODO supply a title</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<form method="post" id="add-edit-form" class="add-edit-form" enctype="multipart/form-data" action="http://localhost:8887/listing-types/edit/2">
<label for="name">Name<span style="color: red;"> *</span></label>
rotexdegba /
Created Jun 18, 2019
A list of changes in PHP 7.0+ all on one page

New Stuff in PHP 7.0

  1. Scalar type definitions: they come in two flavours: coercive (default) and strict. The following types for parameters can now be enforced (either coercively or strictly): strings (string), integers (int), floating-point numbers (float), and booleans (bool). They augment the other types introduced in PHP 5: class names, interfaces, array and callable.
    • Typed pass-by-reference Parameters gotcha: Declared types of reference parameters are checked on function entry, but not when the function returns, so after the function had returned, the argument's type may have changed. For example:
    function array_baz(array &$param)
    	$param = 1;
rotexdegba / object-has-get-property.php
Created Jun 28, 2018
Object Property Detection and Object Property Value Retrieval
View object-has-get-property.php
* A robust way of retrieving the value of a a specified property in
* an instance of a class.
* Works with \stdClass objects created from arrays with numeric key(s)
* (the value of the propertie(s) with numeric key(s) in such \stdClass
* objects will be retrieved by this function).
View old-collection.php
* A collection of Cfs_Model_Base_Record records.
* @package Cfs_Model
class Cfs_Model_Base_Collection extends Solar_Sql_Model_Collection {
rotexdegba / base-class-for-collections.php
Last active Apr 21, 2018
Typed Collection Examples in PHP
View base-class-for-collections.php
abstract class GenericCollection implements \ArrayAccess, \Countable, \IteratorAggregate {
protected $collection_items;
* ArrayAccess: does the requested key exist?
* @param string $key The requested key.
rotexdegba / named-js-functions.js
Last active Dec 12, 2017
How to execute a JavaScript function when I have its name as a string
View named-js-functions.js
// see also
window.example = function () { alert('hello world'); };
name = 'example';
window[name] = function () { alert('hello world'); };
window[name] = new Function( 'alert("hello world")' );
View phpword-view-template-for-promis2.0.php
$phpword_writer_wrapper = new \Promis2\PhpWordWriterWrapper();
// New Word document
$phpWord = new \PhpOffice\PhpWord\PhpWord();
// Do stuff with $phpWord
// ............
// ............
You can’t perform that action at this time.