Skip to content

Instantly share code, notes, and snippets.

View earth3300's full-sized avatar

Earth3300 earth3300

View GitHub Profile
@earth3300
earth3300 / colors-w3c.json
Last active October 8, 2018 15:57
Color data in json format checked for conformance to the W3C naming schema. Unminified in RFC 4627 format (3 space tabs).
[
{
"colorId":0,
"hexString":"#000000",
"rgb":{
"r":0,
"g":0,
"b":0
},
"hsl":{
@earth3300
earth3300 / jsonToTable.php
Created October 8, 2018 21:34 — forked from stilliard/jsonToTable.php
JSON to HTML table
<?php
/**
* JSON data to html table
*
* @param object $data
*
*/
function jsonToTable ($data)
{
@earth3300
earth3300 / index.php
Last active October 8, 2018 23:50
Converts JSON Color Data to HTML
<?php
/**
* EC01 JSON Index.
*
* Allows a JSON data text file to be viewed in a directory through a
* single index file.
*
* @package EC01 JSON Index
* @since 1.0.0
@earth3300
earth3300 / index.php
Created October 12, 2018 16:09
Order Colors By HSL
<?php
/**
* EC01 JSON Index.
*
* Allows a JSON data text file to be viewed in a directory through a
* single index file.
*
* @package EC01 JSON Index
* @since 1.0.0
@earth3300
earth3300 / color-conversion-algorithms.js
Created October 23, 2018 23:03 — forked from mjackson/color-conversion-algorithms.js
RGB, HSV, and HSL color conversion algorithms in JavaScript
/**
* Converts an RGB color value to HSL. Conversion formula
* adapted from http://en.wikipedia.org/wiki/HSL_color_space.
* Assumes r, g, and b are contained in the set [0, 255] and
* returns h, s, and l in the set [0, 1].
*
* @param Number r The red color value
* @param Number g The green color value
* @param Number b The blue color value
* @return Array The HSL representation
@earth3300
earth3300 / index.php
Last active October 31, 2018 15:20
A backup plan in case WordPress is broken.
<?php
/**
* How would you design something in the "real world" if you absolutely needed
* something to work? Often a backup is in place. This could be a backup generator
* or even a flashlight, in case the power went out. As WordPress is a complex
* set of code, which can include many plugins and themes from various sources,
* it can break. If that happens, here is a backup plan. Copy the top part of
* this file to the index file of WordPress in the root directory and then include
* the closing brace `}` at the bottom of the file. Then set SITE_NORMAL to false.
@earth3300
earth3300 / style.css
Last active November 2, 2018 14:07
Minimal CSS using the Media types: all, screen, print and speech.
/**
* Media All
*
* For all media types (screen, print, speech).
*
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries
*/
@media all {
<?php
/**
* -----------------------------------------------------------------------------------------
* Based on `https://github.com/mecha-cms/mecha-cms/blob/master/system/kernel/converter.php`
* -----------------------------------------------------------------------------------------
*/
// HTML Minifier
function minify_html($input) {
@earth3300
earth3300 / style.all.css
Last active November 4, 2018 19:50
Style for EC01 (Concatenated)
/*
Theme Name: EC01 Style
Theme URI: http://ec01.earth3300.info/
Author: Clarence Bos
Author URI: http://ec01.earth3300.info/
Description: Part of a sustainable community design.
Version: 1.0.0
License: GPL v3.0
License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
@earth3300
earth3300 / index.php
Last active November 7, 2018 21:18
EC01 XML Reader. Reads an XML file in the directory in which it is placed and displays it as HTML. Can also be used as a WordPress plugin.
<?php
/**
* EC01 XML Reader
*
* Reads an XML file in the directory in which it is placed and displays it in
* valid HTML. Can also be used as a WordPress plugin.
*
* @package Earth3300\EC01
* @version 0.0.1
* @author Clarence J. Bos <[email protected]>