Skip to content

Instantly share code, notes, and snippets.

View gemmadlou's full-sized avatar

Gemma Black gemmadlou

View GitHub Profile
@gemmadlou
gemmadlou / typography.php
Last active October 14, 2016 08:35
Typography Utility
<?php
class Typography {
public static function removeHangingWord($title) {
preg_match('/( )[&a-z]{1,2}([ ]){1}([&a-zA-Z]){3,}/', $title, $matches);
if (isset($matches[0])) {
$title_partial = str_replace(' ', '&nbsp;', ltrim($matches[0], ' '));
$title = str_replace($matches[0], " $title_partial", $title);
}
return $title;
}
@gemmadlou
gemmadlou / docker-compose.yml
Last active October 15, 2016 21:08
Wordpress Multisite With Docker
version: "2"
services:
nginx-proxy:
image: jwilder/nginx-proxy
container_name: nginx-proxy
ports:
- "80:80"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
@gemmadlou
gemmadlou / readme.md
Last active October 15, 2016 22:33
Provisioning Applications To AWS

Provisioning Applications To AWS

Set Up Docker

On Windows

Install Kitematic - https://kitematic.com/

Fire Up Docker Machine

@gemmadlou
gemmadlou / example.xml
Last active October 17, 2016 14:18
ACF Importing Children XML Into Custom Fields
<page>
<post>
<Panel>
<Name>Gemma</Name>
<PanelImage>
http://unsplash.it/400/500
</PanelImage>
<ID>1</ID>
</Panel>
<Panel>
@gemmadlou
gemmadlou / custom-tinymce-0.php
Created October 18, 2016 16:03 — forked from chrisvanpatten/custom-tinymce-0.php
Register custom style formats to TinyMCE in WordPress
<?php
/**
* custom_tinymce
*/
function vpm_custom_tinymce( $settings ) {
// Define our custom formats
$style_formats = array(
array(
@gemmadlou
gemmadlou / sass-lint.yml
Created October 20, 2016 10:03 — forked from DanielHudson/sass-lint.yml
Sass linting options
# sass-lint config generated by make-sass-lint-config v0.1.2
#
# The following scss-lint Linters are not yet supported by sass-lint:
# DisableLinterReason, ElsePlacement, PropertyCount, SelectorDepth
# SpaceAroundOperator, TrailingWhitespace, UnnecessaryParentReference, Compass::*
#
# The following settings/values are unsupported by sass-lint:
# Linter Indentation, option "allow_non_nested_indentation"
# Linter Indentation, option "character"
# Linter NestingDepth, option "ignore_parent_selectors"
@gemmadlou
gemmadlou / oembed-filter.php
Created October 20, 2016 15:38 — forked from martinjohnyoung/oembed-filter.php
Add a wrapper around oembed objects in WordPress. Should be added to your theme's functions.php
<?php
function funkshun_responsive_videos($html, $url, $attr, $post_id) {
return '<div class="video-wrapper">' . $html . '</div>';
}
add_filter('embed_oembed_html', 'funkshun_responsive_videos', 99, 4);
?>
@gemmadlou
gemmadlou / mvc.php
Last active October 26, 2016 05:16
Implementing MVC In Wordpress - Nested Views
<?php
// Uses a Model as data - not just objects
class UserViewModel {
private $displayName;
public function __construct($displayname) {
$this->displayName = $displayname;
}
@gemmadlou
gemmadlou / test.php
Created October 27, 2016 09:56 — forked from mikedfunk/test.php
phpdoc and psr-2 class example
<?php
/**
* Description
*
* @package RacingJunk
* @copyright 2014 Internet Brands, Inc. All Rights Reserved.
*/
namespace InternetBrands\RacingJunk;
/**
@gemmadlou
gemmadlou / scoregen.js
Created October 30, 2016 01:12
Score Generation - Meetings
var tr = require('transduce');
var R = require('ramda');
var Delegates = [
{ 'name': 'John', likes: ['Cars','Computers']},
{ 'name': 'Lisa', likes: ['Internet']},
{ 'name': 'Amy', likes: []}
];
var Suppliers = [