This file contains hidden or 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
| function array_chunk(input, size, preserve_keys) { | |
| // discuss at: http://phpjs.org/functions/array_chunk/ | |
| // original by: Carlos R. L. Rodrigues (http://www.jsfromhell.com) | |
| // improved by: Brett Zamir (http://brett-zamir.me) | |
| // note: Important note: Per the ECMAScript specification, objects may not always iterate in a predictable order | |
| // example 1: array_chunk(['Kevin', 'van', 'Zonneveld'], 2); | |
| // returns 1: [['Kevin', 'van'], ['Zonneveld']] | |
| // example 2: array_chunk(['Kevin', 'van', 'Zonneveld'], 2, true); | |
| // returns 2: [{0:'Kevin', 1:'van'}, {2: 'Zonneveld'}] | |
| // example 3: array_chunk({1:'Kevin', 2:'van', 3:'Zonneveld'}, 2); |
This file contains hidden or 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
| /** | |
| * Crossbrowser RGBA and Prevention of Opacity Propagation | |
| * Created by Martin Ivanov | |
| * http://wemakesites.net | |
| */ | |
| .outer | |
| { | |
| position: absolute; | |
| top: 24px; |
This file contains hidden or 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
| /** | |
| * CSS3 Tooltips | |
| * Created by Martin Ivanov | |
| * http://wemakesites.net | |
| */ | |
| /* the tooltip will be applied to any element, containing data-title attribute */ | |
| [data-title] | |
| { | |
| position: relative; |
This file contains hidden or 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
| img { | |
| object-fit: cover; | |
| } |
This file contains hidden or 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 | |
| // Prevent loading this file directly and/or if the class is already defined | |
| if ( ! defined( 'ABSPATH' ) || class_exists( 'WPGitHubUpdater' ) || class_exists( 'WP_GitHub_Updater' ) ) | |
| return; | |
| /** | |
| * | |
| * | |
| * @version 1.6 |
This file contains hidden or 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
| Date.prototype.addDays = function(days) { | |
| var dat = new Date(this.valueOf()); | |
| dat.setDate(dat.getDate() + days); | |
| return dat; | |
| }; | |
| // Source: http://stackoverflow.com/questions/497790 | |
| function convertDate ( d ) { | |
| // Converts the date in d to a date-object. The input can be: | |
| // a date object: returned without modification |
This file contains hidden or 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
| /** | |
| * Matches: 0111231234 | 011 123 1234 | 011-123-1234 | 0821231234 | +27821231234 | +2782-123-1234 | +2782 123 1234 | 27111231234 | 2711 123 1234 | 2711-123-1234 | |
| * Non-Matches: (011)1231234 | (+2711) 123 1234 | (011) 123-1234 | |
| /**/ | |
| var pattern2 = new RegExp(/^((?:\+27|27)|0)(\d{2})-?(\d{3})-?(\d{4})$/); | |
| console.log( pattern2.test( '+27134622241' ) ); |
This file contains hidden or 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
| function getStartAndEndDate($week, $year) | |
| { | |
| $time = strtotime("1 January $year", time()); | |
| $day = date('w', $time); | |
| $time += ((7*$week)+1-$day)*24*3600; | |
| $return[0] = date('Y-n-j', $time); | |
| $time += 6*24*3600; | |
| $return[1] = date('Y-n-j', $time); | |
| return $return; |
This file contains hidden or 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
| function _validate_passport( passport ) { | |
| //Utils._strict( [ String ], arguments ); // Thirdparty Function | |
| //trim | |
| passport = passport.replace( /(^\s+|\s+$)/g, '' ); | |
| var passport_characters = passport.split(''); | |
| if( passport_characters.length == 9 ) { |
This file contains hidden or 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 | |
| /* | |
| Plugin name: Single user login | |
| Plugin URI: | |
| Description: | |
| Author: Ben May | |
| Author URI: http://benmay.org/wordpress/single-user-wordpress/ | |
| Version: 0.1 | |
| */ | |
| if( !class_exists( 'WPSingleUserLoggin' ) ) |