Skip to content

Instantly share code, notes, and snippets.

Dalton Rooney daltonrooney

Block or report user

Report or block daltonrooney

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@daltonrooney
daltonrooney / form.js
Last active Sep 24, 2019
Craft CMS + Mailchimp signup form in Vue.js
View form.js
import Vue from 'vue'
import axios from 'axios'
const apiClient = axios.create({
baseURL: '',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
}
})
@daltonrooney
daltonrooney / calendar.js
Created Sep 6, 2019
Output calendar links from event in Vue.js
View calendar.js
var MS_IN_MINUTES = 60 * 1000;
var formatTime = function (date) {
date = new Date(date * 1000);
return date.toISOString().replace(/-|:|\.\d\d\d/g, "")
};
var calendarGenerators = {
google: function (event) {
var startTime = formatTime(event.start);
@daltonrooney
daltonrooney / change-class-on-scroll.html
Last active Dec 6, 2018 — forked from ohiosveryown/change-class-on-scroll.html
Vanilla JS – change/add class based on scroll position.
View change-class-on-scroll.html
// https://codepen.io/cmykw/pen/gemxJm
// layout
<nav/>
// style
<style>
body { min-height: 200vh; }
nav {
@daltonrooney
daltonrooney / .htaccess
Created Sep 6, 2018 — forked from zulfajuniadi/.htaccess
Enable CORS via htaccess.
View .htaccess
Header add Content-Type "application/json"
Header add Access-Control-Allow-Methods "GET,HEAD,POST,PUT,DELETE,OPTIONS"
Header add Access-Control-Allow-Headers "Auth-Token,Content-Type"
Header add Access-Control-Allow-Origin "*"
@daltonrooney
daltonrooney / typekit.editor.php
Created Apr 17, 2017 — forked from mikemanger/typekit.editor.php
Add a TypeKit font to the TinyMCE editor in WordPress.
View typekit.editor.php
add_filter( 'mce_external_plugins', 'my_theme_mce_external_plugins' );
function my_theme_mce_external_plugins( $plugin_array ) {
$plugin_array['typekit'] = get_template_directory_uri() . '/typekit.tinymce.js';
return $plugin_array;
}
@daltonrooney
daltonrooney / acf-migrate-db-pro.php
Last active Sep 19, 2019
Prevent ACF Pro license key from being overwritten during WP Migrate DB Pro migration
View acf-migrate-db-pro.php
<?php
/*
Based on http://github.com/deliciousbrains/wp-migrate-db-pro-tweaks
*/
class ACF_WP_Migrate_DB_Pro_Tweaks {
function __construct() {
add_filter( 'wpmdb_preserved_options', array( $this, 'preserved_options' ) );
}
@daltonrooney
daltonrooney / twig_file_date_extension.php
Created Feb 8, 2017 — forked from Stoffo/twig_file_date_extension.php
Twig Function to get the file mtime in template for HTTP Caching
View twig_file_date_extension.php
<?php
$function_filedate = new Twig_SimpleFunction(
'fileDate',
/**
* @param $file_path
* This function generates a new file path with the last date of filechange
* to support better better client caching via Expires header:
* i.e:
@daltonrooney
daltonrooney / gist:a68fd2d49f2e65cde83297b2484f6564
Created Jan 5, 2017 — forked from jchristopher/gist:9939849
SearchWP's list of common words (stopwords)
View gist:a68fd2d49f2e65cde83297b2484f6564
<?php
array( "a", "able", "above", "across", "after", "afterwards", "again", "against", "ago", "all",
"almost", "alone", "along", "already", "also", "although", "always", "am", "among", "amongst", "amoungst",
"amount", "an", "and", "another", "any", "anyhow", "anyone", "anything", "anyway", "anywhere", "are", "aren't",
"around", "as", "at", "back", "be", "became", "because", "become", "becomes", "becoming", "been", "before",
"beforehand", "behind", "being", "below", "beside", "besides", "between", "beyond", "both", "bottom", "but",
"by", "call", "can", "can't", "cannot", "cant", "co", "con", "could", "couldn't", "couldnt", "de", "did", "do",
"does", "don't", "done", "dont", "down", "due", "during", "each", "eg", "eight", "either", "eleven", "else",
"elsewhere", "empty", "enough", "etc", "etc.", "even", "ever", "every", "everyone", "everything", "everywhere",
@daltonrooney
daltonrooney / functions.php
Last active Apr 7, 2016
Simplify WordPress TinyMCE
View functions.php
<?php
/* Simplify the default tiny MCE */
add_filter( 'mce_buttons', 'wpcustom_mce_buttons_1' );
function wpcustom_mce_buttons_1( $buttons ) {
$buttons = array( 'styleselect','bold', 'italic', 'bullist', 'numlist', 'alignleft', 'aligncenter', 'link', 'unlink', 'pastetext', 'removeformat', 'undo', 'redo');
return $buttons;
}
add_filter( 'mce_buttons_2', 'wpcustom_mce_buttons_2' );
function wpcustom_mce_buttons_2( $buttons ) {
@daltonrooney
daltonrooney / jquery.ba-htmldoc.js
Created Nov 30, 2015 — forked from cowboy/jquery.ba-htmldoc.js
jQuery htmlDoc "fixer" - get HTML, HEAD, BODY in your $(html) - NEEDS TESTING
View jquery.ba-htmldoc.js
/*!
* jQuery htmlDoc "fixer" - v0.2pre - 8/8/2011
* http://benalman.com/projects/jquery-misc-plugins/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
(function($) {
You can’t perform that action at this time.