Skip to content

Instantly share code, notes, and snippets.

View w3guy's full-sized avatar
✍️
Typing...

Collins Agbonghama w3guy

✍️
Typing...
View GitHub Profile
@w3guy
w3guy / gist:00e69230d5f833e64214662cc9d7c98e
Created November 2, 2017 12:24 — forked from m1r0/wp_insert_attachment_from_url.php
WP: Insert attachment from URL
/**
* Insert an attachment from an URL address.
*
* @param String $url
* @param Int $post_id
* @param Array $meta_data
* @return Int Attachment ID
*/
function crb_insert_attachment_from_url($url, $post_id = null) {
@w3guy
w3guy / rfc2822.js
Created October 13, 2017 17:01 — forked from AshKyd/rfc2822.js
A momentjs RFC2822 formatted date string.
var DATE_RFC2822 = "ddd, DD MMM YYYY HH:mm:ss ZZ";
moment().format(DATE_RFC2822);
@w3guy
w3guy / 0-toc.md
Created September 8, 2017 16:29 — forked from benlk/0-toc.md
Collection of notes on WP_UnitTestCase
  1. Table of contents
  2. General information
    1. Terms
    2. General structure of a test
    3. WordPress-specific assertions and test functions
      • enqueues
      • creating posts
      • creating terms
      • attaching images
  • ?
@w3guy
w3guy / wp_mail.md
Created August 9, 2017 05:07 — forked from johnbillion/wp_mail.md
WordPress Emails

WordPress Emails

This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.

This is accurate as of WordPress 4.8, and includes some upcoming changes in WordPress 4.9.

There are a few TODOs left. Please bear with me.

@w3guy
w3guy / blokkit.js
Created June 19, 2017 15:59 — forked from kadamwhite/blokkit.js
Bookmarklet to convert all text on a webpage to the Blokk font, for use when working on mockups in your browser.
(function() {
var css = "*{font-family:\"Blokk Regular\", blokk !important;}",
head = document.getElementsByTagName("head")[0],
style = document.createElement("style");
style.type = "text/css";
if ( style.styleSheet ) {
style.styleSheet.cssText = css;
} else {
style.appendChild( document.createTextNode( css ) );
}
@w3guy
w3guy / emitter.js
Created May 25, 2017 05:35 — forked from maxkostinevich/emitter.js
JavaScript Event Emitter
function Emitter() {
this.events = {};
}
Emitter.prototype.on = function (type, listener) {
this.events[type] = this.events[type] || [];
this.events[type].push(listener);
}
@w3guy
w3guy / emitter.js
Created May 25, 2017 05:35 — forked from maxkostinevich/emitter.js
JavaScript Event Emitter
function Emitter() {
this.events = {};
}
Emitter.prototype.on = function (type, listener) {
this.events[type] = this.events[type] || [];
this.events[type].push(listener);
}
@w3guy
w3guy / pe-customize-controls.css
Created February 13, 2017 17:32 — forked from OriginalEXE/pe-customize-controls.css
Extending WordPress Customizer Panels and Sections to allow nesting
.in-sub-panel #customize-theme-controls .customize-pane-child.current-panel-parent,
#customize-theme-controls .customize-pane-child.current-section-parent {
-webkit-transform: translateX(-100%);
-ms-transform: translateX(-100%);
transform: translateX(-100%);
}
@w3guy
w3guy / blog-webpack-2.md
Created October 31, 2016 03:41 — forked from xjamundx/blog-webpack-2.md
From Require.js to Webpack - Part 2 (the how)

This is the follow up to a post I wrote recently called From Require.js to Webpack - Party 1 (the why) which was published in my personal blog.

In that post I talked about 3 main reasons for moving from require.js to webpack:

  1. Common JS support
  2. NPM support
  3. a healthy loader/plugin ecosystem.

Here I'll instead talk about some of the technical challenges that we faced during the migration. Despite the clear benefits in developer experience (DX) the setup was fairly difficult and I'd like to cover some of the challanges we faced to make the transition a bit easier.

## CLI
https://github.com/zfcampus/zf-console
[https://github.com/mnapoli/silly](Silly CLI micro-framework based on Symfony Console)
## GitHub authors
https://github.com/mnapoli?tab=repositories