Skip to content

Instantly share code, notes, and snippets.

View bmarshall511's full-sized avatar

Ben Marshall bmarshall511

View GitHub Profile
@bmarshall511
bmarshall511 / findindex.js
Created January 6, 2022 15:42
Finds the index of a JS array that equals the array key value.
const items = {
[
id: 1,
name: 'Ben'
],
[
id: 2,
name: 'Angel'
],
[
@bmarshall511
bmarshall511 / .gitignore
Created November 2, 2020 13:43
WordPress Development .gitignore Example
# unneccesry files
wflogs
package-lock.json
wp-content/db/
wp-content/cache/
wp-content/backups/
# WordPress #
############
wp-config-local.php
@bmarshall511
bmarshall511 / emulsify-foundation.md
Last active April 26, 2022 09:10
Setup for Emulsify & Foundation (Drupal 8)

TODO

  • Gulp clean task for JS files
  • Load individual Foundation JS plugins vs. the minified version

Require

  • components
  • paragraphs
  • unified-twig-extensions
  • field_layout
@bmarshall511
bmarshall511 / template-functions.php
Created April 4, 2017 19:16
Adding WordPress plugin template files.
<?php
/**
* Locate template.
*
* Locate the called template.
* Search Order:
* 1. /themes/theme/templates/$template_name
* 2. /themes/theme/$template_name
* 3. /plugins/plugin/templates/$template_name.
*
@bmarshall511
bmarshall511 / template-functions.php
Created April 4, 2017 19:13
Override WordPress template files.
<?php
/**
* Template loader.
*
* The template loader will check if WP is loading a template
* for a specific Post Type and will try to load the template
* from out 'templates' directory.
*
* @since 1.0.0
*
@bmarshall511
bmarshall511 / template-functions.php
Last active April 4, 2017 19:12
Load a WordPress plugin template.
<?php
/**
* Get template.
*
* Search for the template and include the file.
*
* @since 1.0.0
*
* @see PLUGIN_locate_template()
*
@bmarshall511
bmarshall511 / template-functions.php
Last active June 29, 2023 10:23
Locate a WordPress plugin template.
<?php
/**
* Locate template.
*
* Locate the called template.
* Search Order:
* 1. /themes/theme/templates/$template_name
* 2. /themes/theme/$template_name
* 3. /plugins/plugin/templates/$template_name.
*
@bmarshall511
bmarshall511 / CONTRIBUTING.md
Created October 18, 2016 14:26
Contributing

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a
<?php
$me = (new FacebookRequest(
$session, 'GET', '/me'
))->execute()->getGraphObject(GraphUser::className());
<?php
$request = new FacebookRequest($session, 'GET', '/me');
$response = $request->execute();
$graphObject = $response->getGraphObject();