Skip to content

Instantly share code, notes, and snippets.

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

Collins Agbonghama w3guy

✍️
Typing...
View GitHub Profile
* Downloaded or downloading
=============================
**http://kickass.to/infiniteskills-learning-jquery-mobile-working-files-t7967156.html
**http://kickass.to/lynda-bootstrap-3-advanced-web-development-2013-eng-t8167587.html
**http://kickass.to/lynda-css-advanced-typographic-techniques-t7928210.html
**http://kickass.to/lynda-html5-projects-interactive-charts-2013-eng-t8167670.html
**http://kickass.to/vtc-html5-css3-responsive-web-design-course-t7922533.html
*http://kickass.to/10gen-m101js-mongodb-for-node-js-developers-2013-eng-t8165205.html
*http://kickass.to/cbt-nuggets-amazon-web-services-aws-foundations-t7839734.html
<?php
class ContactFormHandler
{
public function __construct(ContactFormTemplate $template, ContactFormValidator $validator, ContactFormMailer $mailer)
{
$this->template = $template;
$this->validator = $validator;
$this->mailer = $mailer;
}
<?php
/*Add this code to your functions.php file of current theme OR plugin file if you're making a plugin*/
//add the button to the tinymce editor
add_action('media_buttons_context','add_my_tinymce_media_button');
function add_my_tinymce_media_button($context){
return $context.=__("
<a href=\"#TB_inline?width=480&inlineId=my_shortcode_popup&width=640&height=513\" class=\"button thickbox\" id=\"my_shortcode_popup_button\" title=\"Add My Shortcode\">Add My Shortcode</a>");
}
<?php
/**
* Plugin Name: Multiple Roles per User
* Description: Allows anyone who can edit users to set multiple roles per user. In a default WordPress environment that wouldn't have much of an effect, since the user would have the privileges of the top-privileged role that you assign to him. But if you have custom roles with custom privileges, this might be helpful.
* Version: 1
* Author: nikolov.tmw
* Author URI: http://paiyakdev.com/
* License: GPL2
*/
/*
@w3guy
w3guy / backup.sh
Last active August 29, 2015 14:12 — forked from codeablehq/backup.sh
#!/bin/bash
# For this script to work, save it somewhere in the executable path, like /usr/local/sbin/backup.sh
# make it executable: chmod +x /usr/local/sbin/backup.sh
# then add it to cron: crontab -e
# and add the line below, which will run backup 3am each day, then upload to Dropbox
# 0 3 * * * /usr/local/sbin/backup.sh > /dev/null 2>&1
# You also need WP CLI installed: http://wp-cli.org/
@w3guy
w3guy / README.md
Last active August 29, 2015 14:22 — forked from tomazzaman/README.md

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

@w3guy
w3guy / gist:55d136cd19c0e1d78c3c
Created December 30, 2015 08:06 — forked from craigchristenson/gist:3841142
2Checkout Return
<?php
$hashSecretWord = 'tango'; //2Checkout Secret Word
$hashSid = 1303908; //2Checkout account number
$hashTotal = '1.00'; //Sale total to validate against
$hashOrder = $_REQUEST['order_number']; //2Checkout Order Number
$StringToHash = strtoupper(md5($hashSecretWord . $hashSid . $hashOrder . $hashTotal));
if ($StringToHash != $_REQUEST['key']) {
$result = "Fail - Hash Mismatch";
} else {
@w3guy
w3guy / gist:d717de3b12487a2c8399
Created December 30, 2015 08:06 — forked from craigchristenson/gist:2869509
Example PHP script to check fraud status on a sale.
<?php
if ($_POST['message_type'] == 'FRAUD_STATUS_CHANGED') {
$insMessage = array();
foreach ($_POST as $k => $v) {
$insMessage[$k] = $v;
}
$hashSecretWord = "tango"; # Input your secret word
@w3guy
w3guy / mail.php
Created April 19, 2016 05:01 — forked from rantastic/mail.php
PHP: Send email using amazon SES
<?php
//class docs: http://www.orderingdisorder.com/aws/ses/
require_once('ses.php');
//get credentials at http://aws.amazon.com My Account / Console > Security Credentials
$ses = new SimpleEmailService('ACCESSkeyID', 'SECRETaccessKEY');
$m = new SimpleEmailServiceMessage();
@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.