Skip to content

Instantly share code, notes, and snippets.

@beau-gosse
beau-gosse / webpack.config.js
Created June 20, 2018 15:13
A sample webpack config file to quickly launch basic projects.
//! Webpack configuration file for production mode
// tested with webpack v4.12.0
/**
* Imports
*/
const autoprefixer = require('autoprefixer');
const webpack = require('webpack');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
@beau-gosse
beau-gosse / jquery.geturlvars.js
Last active December 30, 2017 06:34 — forked from screamwork/jQuery - Get URL vars
jQuery - Get URL vars
$.extend({
getUrlVars: function(){
var vars = [], hash;
var url = window.location.href;
var url_enc = encodeURIComponent(url);
var url_dec = decodeURIComponent(url_enc);
var hashes = url_dec.slice(url_dec.indexOf('?') + 1).split('&');
for(var i = 0; i < hashes.length; i++)
{
hash = hashes[i].split('=');
@beau-gosse
beau-gosse / jquery_iife_template.js
Created January 7, 2016 18:52
JQuery Immediately Invoked Function Expression -- Quick start template
<script>
// IIFE -> Within this function, $ will always refer to jQuery
(function($) {
/* Execute on DOM ready */
$(function() {
// # code goes here
});
/* Execute later */
@beau-gosse
beau-gosse / dynamicbiblesearchlanding.js
Created January 7, 2016 18:42
[MODX] Change Bible search landing page with JQuery via dropdown menu.
// # Change search action, update placeholders and dropdown menu texts
var radio = $('input[name="target"]');
radio.change(function(e) {
var form = $('#searchform'),
target = $("input[name=target]:checked"),
targetselect = $('#target_select'),
targetlabel = target.data('label'),
search = $('#search'),
caret = '<span class="caret"></span>',
version = $('#version'),
@beau-gosse
beau-gosse / disqus.lazyload.js
Created January 7, 2016 18:29
Lazy load Disqus with JQuery -- Murat Corlu's method.
// # Lazy load Disqus w/ Murat Corlu's method.
var disqus_div = $("#disqus_thread");
if (disqus_div.size() > 0) {
var disqus_loaded = false,
// Where to start loading
top = disqus_div.offset().top,
disqus_data = disqus_div.data(),
check = function() {
if (!disqus_loaded && $(window).scrollTop() + $(window).height() > top) {
disqus_loaded = true;
@beau-gosse
beau-gosse / activeuser.chunk.tpl
Created December 7, 2015 09:47 — forked from splittingred/activeuser.chunk.tpl
A MODX Snippet to show active, logged in users
<li>[[+username]]</li>
@beau-gosse
beau-gosse / jquery_disqus_lazyload.js
Created December 3, 2015 20:22 — forked from omgmog/jquery_disqus_lazyload.js
Load disqus comments when visitor scroll down page to comments
/**
* Load disqus comments when visitor scroll down page to comments
*
* Usage:
* Add a div with id "disqus_thread" and data attributes for every disqus parameter:
*
* <div id="disqus_thread" data-disqus-shortname="username" data-disqus-url="http://example.com/post/post-name/"></div>
*
* @author: Murat Corlu
* @link: https://gist.github.com/gists/2290198
@beau-gosse
beau-gosse / Setting up Google Cloud Storage with CORS for Web Fonts.md
Created November 18, 2015 19:32 — forked from mhulse/Setting up Google Cloud Storage with CORS for Web Fonts.md
Setting up CORS on Google Cloud Storage: An unofficial quick start guide to serving web fonts from Google's cloud. (I'm sure a lot of this info could be improved... Please leave comments if you have tips/improvements.)

Login:

Google Cloud Storage

You'll want to login using an official Google account (i.e. if this is for your company, use the comapany Gmail account vs. a personal one.)

When logging in, you might be prompted to verify the account; if so, enter your cell number to get a verification e-mail or phone call.

Once verified, you'll have to agree to the terms of service; do that, and click continue.

@beau-gosse
beau-gosse / modx-snippets.php
Created September 23, 2015 01:42 — forked from christianhanvey/modx-snippets.php
Useful snippets for MODX Revo
Snippet: [[SnippetName]]
Chunk: [[$ChunkName]]
System Setting: [[++SettingName]]
TV: [[*fieldName/TvName]]
Link tag: [[~PageId? &paramName=`value`]]
Placeholder: [[+PlaceholderName]]
<?php
@beau-gosse
beau-gosse / html5_valid_elements.js
Last active September 21, 2015 07:43 — forked from veprbl/html5_valid_elements.js
TinyMCE valid_elements setting for HTML5
valid_elements : ""
+"@[accesskey|draggable|style|class|hidden|tabindex|contenteditable|id|title|contextmenu|lang|dir<ltr?rtl|spellcheck|"
+"onabort|onerror|onmousewheel|onblur|onfocus|onpause|oncanplay|onformchange|onplay|oncanplaythrough|onforminput|onplaying|onchange|oninput|onprogress|onclick|oninvalid|onratechange|oncontextmenu|onkeydown|onreadystatechange|ondblclick|onkeypress|onscroll|ondrag|onkeyup|onseeked|ondragend|onload|onseeking|ondragenter|onloadeddata|onselect|ondragleave|onloadedmetadata|onshow|ondragover|onloadstart|onstalled|ondragstart|onmousedown|onsubmit|ondrop|onmousemove|onsuspend|ondurationmouseout|ontimeupdate|onemptied|onmouseover|onvolumechange|onended|onmouseup|onwaiting],"
+"a[target<_blank?_self?_top?_parent|ping|media|href|hreflang|type"
+"|rel<alternate?archives?author?bookmark?external?feed?first?help?index?last?license?next?nofollow?noreferrer?prev?search?sidebar?tag?up"
+"],"
+"abbr,"
+"address,"
+"area[alt|coords|shape|href|target<_blank?_self?_top?_parent|ping|media