Skip to content

Instantly share code, notes, and snippets.

View earth3300's full-sized avatar

Earth3300 earth3300

View GitHub Profile
<?php
defined( 'NDA' ) || exit('Access denied.');
/**
* A community consists of a group of people who have passed a test to become members.
*/
abstract class Community {
/**
<?php
/** Do not allow direct access */
defined( 'NDA' ) || exit('Access Denied.');
/**
* Interface
*
* This file attempts to implement formatting and documentation standards
* so that it can be used with a higher degree of confidence as a template.
<?php
defined( 'NDA' ) || exit('Access Denied.');
/**
* Pattern Abstract Class Function
*
* @link http://www.primitivetype.com/articles/php_5_abstract_classes_and_methods.php
*/
<?php
defined('NDA') || exit('Access denied.');
/**
* Plugin Name: OOP Plugin
* Description: A very basic plugin using OOP (Interface, Abstract Class, Class and Function).
* Version: 2018.08.24
* License: GPLv2+
*/
{
"name":"Reverse Grocery Shopping List",
"type":"maxium",
"store":"high-end",
"date":"2018-08-25",
"desc":"The most that could be spent to guarantee that the item could be bought for that price.",
"method":"Starting in the area where one enters the store, quickly jotting down the price of the item with pen and notebook, as well as the volume or weight and the most expected that the item could be sold for, within the next year. Not the sale price. Including tax and a small margin. Generous, not minimal, even in a 'low end' store. This ensures that one can walk out with the items on the list, with some to spare.",
"list" :[
{
"name":"juice",
{
"name":"Reverse Grocery Shopping List",
"type":"maxium",
"store":"low-end",
"date":"2018-08-26",
"desc":"The most that could be spent to guarantee that the item could be bought for that price.",
"method":"Starting in the area where one enters the store, quickly jotting down the price of the item with pen and notebook, as well as the volume or weight and the most expected that the item could be sold for, within the next year. Not the sale price. Including tax and a small margin. Generous, not minimal, even in a 'low end' store. This ensures that one can walk out with the items on the list, with some to spare.",
"list" :[
{
"name":"sweet-corn",
@earth3300
earth3300 / .htaccess
Last active August 29, 2018 14:35
Time based routing (.htaccess)
# Logic based routing.
# STEP 1. BASED ON TIME.
# A. If the time is between 9 AM and 5 PM (local), we are open.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{TIME_HOUR} <18
RewriteCond %{TIME_HOUR} >08
@earth3300
earth3300 / .htaccess
Created August 29, 2018 20:50
Time based page display. Shows one or the other file based on seconds in minute.
# Time Based Page Display
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{TIME_SEC} <30
RewriteRule ^index\.html$ page/one.html [L]
RewriteCond %{TIME_SEC} >29
RewriteRule ^index\.html$ page/two.html [L]
</IfModule>
@earth3300
earth3300 / .htaccess
Last active August 29, 2018 20:59
Time of day based page dispaly.
# Time of day based page display.
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
# 5am > < 8am
RewriteCond %{TIME_HOUR} >02
RewriteCond %{TIME_HOUR} <05
@earth3300
earth3300 / required-wp-admin-url.php
Last active August 30, 2018 18:43
Changes the WP /wp-admin url to /admin for for consistency and standardization purposes.
/**
* Change the /wp-admin url to /admin
*
* Adapted from {@link https://gist.github.com/hakre/701245}
*/
class WPAdminUrl {
/**
* The instance of the class
*/