CSS Modules lets you write and use simple class names rather than remembering and maintaining long unique class names for every component. CSS Modules mutates all of your classnames from each partials into new, completely unique classnames that will not conflict when they are bundled together into your main CSS file. Then, a JSON file is generated that maps the happy classnames from each file to the unique classname in the combined file. You load this map in PHP, and begin using the easy-to-remember classnames as you wish.
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
#!/usr/bin/env babel-node | |
require('dotenv').config() | |
import contentful from 'contentful' | |
import fs from 'fs-extra-promise' | |
// Contentful Config | |
const apiToken = process.env.CONTENTFUL_DELIVERY_API_TOKEN | |
const spaceId = process.env.CONTENTFUL_SPACE_ID | |
const client = contentful.createClient({ accessToken: apiToken, space: spaceId }) |
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 | |
######### router.php ######### | |
# | |
# This file implements basic server routing and rewrite rules; | |
# Run the following command from the project root: | |
# | |
# php -S localhost:5000 -t path/to/wordpress path/to/router.php | |
# | |
# ^ hostname ^ root ^ server router |
So far the following areas are covered in this gist:
- Removing tabs on the product page.
- Cleaning the WooCommerce loading of scripts/styles on pages with no woo elements.
- Changing the call order of features on the single product.
- Removing all WooCommerce called styles.
- Ajaxifying the cart add
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
var util = require("util"); | |
function Thing() { | |
// The instance is also a proxy function for its __default method. | |
var instance = function() { | |
return instance.__default.apply(instance, arguments); | |
}; | |
// The instance needs to inherit from Thing.prototype. | |
instance.__proto__ = Thing.prototype; | |
// Initialize the instance with the __ctor method. |
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
/* bling.js */ | |
window.$ = document.querySelector.bind(document); | |
window.$$ = document.querySelectorAll.bind(document); | |
Node.prototype.on = window.on = function(name, fn) { this.addEventListener(name, fn); }; | |
NodeList.prototype.__proto__ = Array.prototype; | |
NodeList.prototype.on = function(name, fn) { this.forEach((elem) => elem.on(name, fn)); }; |
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 | |
/** | |
* Verbose Beautified Date Range | |
* | |
* @access public | |
* @param mixed $start_date | |
* @param mixed $end_date | |
* @return $date_range (beautified date range) | |
* @license WTFPL | |
* |
I am not a security expert, so take it for what its worth.
OpenSSH has this ability built in, few people just seem to use the feature. Below is what works for me, but if you have a better way please share the uninformed.
- First create a new app inside of the SP control panel
- Now, decide what direcoty you want to put the users directory; either `` or
/public
. This will keep trolls at bay.
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 | |
// Stirct types | |
function test(string $name, int $age, float $cuteness, bool $evil) { | |
//.... | |
} | |
// Convert types | |
function test((string)$name, (int)$age, (float)$cuteness, (bool)$evil) { | |
//.... |