Skip to content

Instantly share code, notes, and snippets.

View mcmullengreg's full-sized avatar

Gregory McMullen mcmullengreg

View GitHub Profile
<?php
function themename_customize_register($wp_customize){
$wp_customize->add_section('themename_color_scheme', array(
'title' => __('Color Scheme', 'themename'),
'priority' => 120,
));
// =============================
@mcmullengreg
mcmullengreg / twitterEmbed.cshtml
Created April 20, 2015 23:46
Embedded Twitter Feed for Umbraco
@* Embedded Twitter Feed
* ---------------------
* Create a widget from Twitter.com FIRST - https://twitter.com/settings/widgets
* Embedded Timeline API - https://dev.twitter.com/docs/embedded-timelines
* All of these settings are for the local end. User & Search information
* Should be setup on the actually widget creation page.
*
*
*@
@mcmullengreg
mcmullengreg / FormManager.cshtml
Created April 20, 2015 23:56
Umbraco Macro: Form Manager
@inherits umbraco.MacroEngines.DynamicNodeContext
@{
if ( String.IsNullOrEmpty(@Parameter.mediaFolder) ) {
&ltp>A folder has not been selected</p>
}
var folder = Parameter.mediaFolder;
var media = Model.MediaById(folder);
}
@mcmullengreg
mcmullengreg / StructuredTitles.cshtml
Created April 21, 2015 00:05
Umbraco Structured Titles
@{
var homePage = "";
var pagesTitle = "";
var CatTitle = "";
var Level4Parent = "";
@* - HOMEPAGE TITLE - *@
if ( @Model.Level <= 1 && @Model.AncestorOrSelf(1).HasValue("pageTitle") ) {
homePage = @Model.AncestorOrSelf(1).pageTitle; }
else {
@mcmullengreg
mcmullengreg / divider.cshtml
Created April 21, 2015 00:12
Global Variables
var divider = (i == 2) ? " | " :
(i > 2) ? " - " : "";
@mcmullengreg
mcmullengreg / Wordpress.php
Last active August 29, 2015 14:21
Editor Mods for OL Reversed
/*
This code goes in your functions.php
Check your themes functions file as they may already be using this.
*/
// Add Formats Dropdown Menu To MCE
add_filter( 'mce_buttons', 'mce_style_button' );
if ( ! function_exists( 'mce_style_button' ) ) {
function mce_style_button( $buttons ) {
array_push( $buttons, 'styleselect' );
return $buttons;
@mcmullengreg
mcmullengreg / simple-mail.php
Last active August 29, 2015 14:26
Simple $_POST Email Form. This form does not contain any form validation and has very little security checking on the backend and nothing on the front end.
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>Basic PHP Form Processing</title>
</head>
<body>
<h1>Basic Form</h1>
<?php if (empty($_POST)) : ?>
@mcmullengreg
mcmullengreg / wp-core.scss
Created August 18, 2015 16:06
WordPress Core - SCSS
/* =WordPress Core
-------------------------------------------------------------- */
.alignnone {
margin: 5px 20px 20px 0;
}
.aligncenter {
display: block;
margin: 5px auto 5px auto;
}
@mcmullengreg
mcmullengreg / upload-media.js
Created October 14, 2015 18:25
Widget for a featured area with selectable content and using WP image upload.
jQuery(document).ready(function($) {
$(document).on("click", ".upload_image_button", function() {
jQuery.data(document.body, 'prevElement', $(this).prev());
window.send_to_editor = function(html) {
var imgurl = jQuery('img',html).attr('src');
var inputText = jQuery.data(document.body, 'prevElement');
if(inputText != undefined && inputText != '')
@mcmullengreg
mcmullengreg / ColdFusion-Git-Webhook.cfm
Last active December 5, 2022 21:02
Webhoook integration for ColdFusion. Downloads the Zip after a push event and moves the contents to a folder determined based on the repository name. Used as a means of keeping testing environments updated whenever new commits are pushed to the master.
<!--- Webhook secrets -- yours, not mine. --->
<cfset secret = "">
<cftry>
<cfset _payload = "{}">
<cfset _payload = getHttpRequestData()>
<cfset jsonPayload = form.payload>
<cfset hash = RemoveChars(_payload.headers['X-Hub-Signature'], 1, 5)>
<cfset payload_hash = hmac(_payload.content, secret, 'HMACSHA1')>