Skip to content

Instantly share code, notes, and snippets.

View philleepflorence's full-sized avatar

Philleep Florence philleepflorence

View GitHub Profile
@philleepflorence
philleepflorence / blog.sample.js
Created July 26, 2019 21:26
JavaScript: Nerd Translation For The Novice
const tutorial = function () {
/* Change HTML Content */
document.getElementById("element").innerHTML = "Hello JavaScript!";
/* Change an Image */
document.getElementById('element').src='pic_bulboff.gif'";
/* Change the Style (CSS) of an element */
@philleepflorence
philleepflorence / blog.sample.css
Created July 10, 2019 15:37
CSS: Nerd Translation For The Novice
/* Color! */
p {
color: white;
background-color: black;
}
/* Style! */
p {
@philleepflorence
philleepflorence / blog.sample.html
Last active July 2, 2019 18:18
HTML: Nerd Translation For The Novice
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>HTML: Nerd Translation For The Novice</title>
<meta name="description" content="HTML: Nerd Translation For The Novice">
<meta name="author" content="Philleep Florence">
@philleepflorence
philleepflorence / directus.configuration.filters.pagination.php
Last active May 6, 2019 21:38
Directus - Add Pagination options to API responses
<?php
use Directus\Bootstrap;
use Directus\Util\ArrayUtils;
use Directus\Database\TableGateway\RelationalTableGateway;
return [
'session' => [
'prefix' => 'directus6_'
],
@philleepflorence
philleepflorence / directus.collections.update.sql
Created April 29, 2019 23:55
Change the name of a collection within Directus - v6.x
# How to use = CALL `DIRECTUSTABLES`('old_table_name', 'new_table_name');
DELIMITER ;;
CREATE PROCEDURE `DIRECTUSTABLES`(IN old_table_name VARCHAR(50), IN new_table_name VARCHAR(50))
BEGIN
# Change the name of the table - BACK UP DB BEFORE STARTING!!!.
DECLARE sql_statement VARCHAR(1024);
SET @SQL := CONCAT('ALTER TABLE `', old_table_name, '` RENAME TO `', new_table_name, '`');
@philleepflorence
philleepflorence / directus.blog.collections.sql
Created April 29, 2019 18:47
Directus: Creating a Blog using Directus
# Collections - Directus v6.x
CREATE TABLE `contents_posts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`status` int(1) NOT NULL DEFAULT '2',
`sort` int(11) DEFAULT NULL,
`feature` tinyint(1) DEFAULT NULL COMMENT 'Feature post in various sections of application',
`source` varchar(250) DEFAULT NULL COMMENT 'Source URL for Post - Optional',
`post_type` int(11) DEFAULT NULL COMMENT 'Type of Post - Blog, Article, News, et al',
`page` int(11) DEFAULT NULL COMMENT 'Primary page where item should be displayed - required for setting up Page Metadata',
@philleepflorence
philleepflorence / directus.bookmark.js
Last active February 11, 2019 04:06
Directus - Global Bookmarks
/*
Global Bookmarks
Example: [domain]/tables/[table-name]?filters[neighborhood][like]=West%20Village
Add window.location.search to data going to the server for fetcing items
Add script after document.load event or in an init function
GLOBAL VARIABLES:
var version = '1.1' - dynamic depending of API version
*/
Backbone._sync = Backbone.sync;
@philleepflorence
philleepflorence / sails.v0.12.pipeline.js
Created October 24, 2017 20:22
Implementing no cache on style and script assets - /tasks/config/pipeline.js
/**
* `sails-linker`
*
* ---------------------------------------------------------------
*
* Automatically inject <script> tags and <link> tags into the specified
* specified HTML and/or EJS files. The specified delimiters (`startTag`
* and `endTag`) determine the insertion points.
*
* #### Development (default)
@philleepflorence
philleepflorence / directus.custom.endpoint.preview.php
Created August 9, 2017 15:34
Handling Redirects - Previews Custom Endpoint for handling multiple environments, domains, and applications.
<?php
use Directus\Bootstrap;
use Directus\View\JsonView;
use Directus\Database\TableGateway\RelationalTableGateway;
use Directus\Util\ArrayUtils;
use Directus\Util\DateUtils;
use Directus\Util\StringUtils;
@philleepflorence
philleepflorence / directus.endpoint.combine.php
Last active February 11, 2019 04:01
Directus Custom Endpoint - Combining Multiple Responses into One
<?php
use Directus\Bootstrap;
use Directus\View\JsonView;
use Directus\Database\TableGateway\RelationalTableGateway;
use Directus\Util\ArrayUtils;
use Directus\Util\DateUtils;
use Directus\Util\StringUtils;