Skip to content

Instantly share code, notes, and snippets.

View gemmadlou's full-sized avatar

Gemma Black gemmadlou

View GitHub Profile
@gemmadlou
gemmadlou / getCache.js
Created June 18, 2016 09:04 — forked from contolini/getCache.js
Memoization of jQuery's $.getJSON() to use localStorage for caching.
var getCache = function(url) {
var supportsLocalStorage = 'localStorage' in window;
// Both functions return a promise, so no matter which function
// gets called inside getCache, you get the same API.
function getJSON(url) {
var promise = $.getJSON(url);
@gemmadlou
gemmadlou / aws-lambda.js
Last active June 22, 2016 12:31
AWS Login & Authentication
var AWS = require('aws-sdk');
var request = require('request');
var GOOGLE_CLIENT_ID = 'XXXXXX.apps.googleusercontent.com ';
var GOOGLE_URL = 'https: //www.googleapis.com/oauth2/v3/tokeninfo?id_token=';
var idPoolID = 'us-east-1:XXXXXXX';
var roleArn = 'arn:aws:iam::XXXXXX:role/Cognito_AdminStaffAuth_Role';
var cognitoidentity = new AWS.CognitoIdentity({
region: 'us-east-1'
});
module.exports = function(credentials, context) {
@gemmadlou
gemmadlou / wordpress-pantheon-visual-composer.md
Last active June 29, 2016 11:53
Wordpress, Pantheon & Visual Composer

Security

Security Plugins

  • Securi Scanner - No (?)
  • Wordfence - Partly (?)

Security that's already provided by Pantheon

Pantheon's Security

@gemmadlou
gemmadlou / wordpress-workflow.md
Last active July 1, 2016 19:35
Wordpress Workflow

Wordpress Workflow

Checklist

Category Sub-category Action
Scoping Design & Functionality List layouts
Scoping Design & Functionality List components
Scoping Design & Functionality List modules
@gemmadlou
gemmadlou / package.json
Last active July 1, 2016 21:11
Frontend Package JSONs
{
"name": "tbneventapp",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "browserify app/source/app.js -o app/build/app.js -v -t [ envify --APP_ENV development ] -t [ babelify --presets [ es2015 react ] ]",
"run-server": "watch-http-server",
"watch-app": "watchify source/app.js -o app/build.js -v -t [ envify --APP_ENV development ] -t [ babelify --presets [ es2015 react ] ]",
@gemmadlou
gemmadlou / main.scss
Last active September 5, 2016 17:11
Inline Text Background Solution
.c-slab-text {
padding: 0.3em 0;
position: relative;
padding-left: 20px;
overflow: hidden;
&:before {
content: ' ';
position: absolute;
top: -2px;
<?php
// Save post Hook
function grab_fb_video_image( $post_id, $post) {
if ( wp_is_post_revision( $post_id ) )
return;
$image = get_field('featured_image');
if ($image || is_null($image)) { // No need to continue - image is already there, or no field exists
#nginx
127.0.0.1 server.dev
@gemmadlou
gemmadlou / acf-field-registration-example.php
Created September 5, 2016 09:47 — forked from mgburns/acf-field-registration-example.php
Example programmatic registration of Advanced Custom Fields fields
<?php
/**
* Example programmatic registration of Advanced Custom Fields fields
*
* @see http://www.advancedcustomfields.com/resources/register-fields-via-php/
*/
function register_custom_acf_fields() {
if ( function_exists( 'acf_add_local_field_group' ) ) {
@gemmadlou
gemmadlou / color-matrices-orange.html
Last active September 6, 2016 15:20
Color Matrices Using FeColorMatrix
<!-- Color Matrices -->
<svg>
<filter id="red-matrix" color-interpolation-filters="sRGB">
<feColorMatrix
type="matrix"
values="0.6 0.8 -0.2 0 0
0.1 0.1 0.5 0 0
-0.3 0 0 0 0
0 0 0 1 0" />
</filter>