Skip to content

Instantly share code, notes, and snippets.

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

Collins Agbonghama w3guy

✍️
Typing...
View GitHub Profile
@UVLabs
UVLabs / make-pot.sh
Last active July 16, 2024 04:58
Using WordPress makepot.php to generate pot file used for the internationalization of your plugin or theme.
#!/bin/bash
php path/to/makepot.php wp-plugin /path/to/your/plugin pluginname.pot
#php path/to/makepot.php wp-theme /path/to/your/theme themename.pot
<?php
/**
* A search section.
*
* @package Customizer Search
* @subpackage Core
* @copyright Copyright (c) 2017, Aristeides Stathopoulos
* @license http://opensource.org/licenses/https://opensource.org/licenses/MIT
* @since 1.0.0
*/
( function( api ) {
'use strict';
// Add callback for when the header_textcolor setting exists.
api( 'header_textcolor', function( setting ) {
var isHeaderTextDisplayed, linkSettingValueToControlActiveState;
/**
* Determine whether the site title and tagline should be displayed.
*
@maxkostinevich
maxkostinevich / emitter.js
Created February 16, 2016 10:04
JavaScript Event Emitter
function Emitter() {
this.events = {};
}
Emitter.prototype.on = function (type, listener) {
this.events[type] = this.events[type] || [];
this.events[type].push(listener);
}
@zach-adams
zach-adams / sync-sql.sh
Created July 15, 2015 17:04
A copy of import-sql.sh with edits to refresh databases on vagrant up
#!/bin/bash
#
# Sync the sql files in the sync folder
#
# The files in the {vvv-dir}/database/sync/ directory should be created by
# mysqldump or some other export process that generates a full set of SQL commands
# to create the necessary tables and data required by a database.
#
# For a sync to work properly, the SQL file should be named `db_name.sql` in which
# `db_name` matches the name of a database already created in {vvv-dir}/database/init-custom.sql
@xjamundx
xjamundx / blog-webpack-2.md
Last active November 7, 2024 13:10
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.

@tomazzaman
tomazzaman / README.md
Last active March 31, 2021 06:30
Simple WordPress Optin form with CURL support

Simple Optin form example for WordPress

This is a simplified showcase of how you can easily build your own Optin form in WordPress.

It can connect to any API that supports cURL (most of them do). There is no error reporting implemented. It uses exit intent detection script called Ouibounce, which needs to be enqueued in your functions.php

See the tutorial here: How to build your own WordPress email form

INITIALISATION
==============
load wp-config.php
set up default constants
load wp-content/advanced-cache.php if it exists
load wp-content/db.php if it exists
connect to mysql, select db
load object cache (object-cache.php if it exists, or wp-include/cache.php if not)
load wp-content/sunrise.php if it exists (multisite only)
@timersys
timersys / gist:4480bccf64a1147abb3d
Last active February 22, 2021 18:42
wp_remote_get debug script
<?php
/**
* Plugin Name: Wp Remote Test
* Plugin URI:
* Version: 0.1
* Description: Debug wp_remote_get and wp_remote_post
* Author: Damian Logghe
* Author URI: http://wp.timersys.com
*/
@nealrs
nealrs / neal.json
Last active June 1, 2022 21:09
source file for NealAPI (Git@Me issue 69)
{
"neal" : [
{
"year":1983,
"live": "New Delhi, India",
"school": null,
"work": null
},
{
"year":1984,