Skip to content

Instantly share code, notes, and snippets.

<!-- /*
/
/ \_|\ /
/ /
/ A-Train Marketing /
/ /
ATDemo 0.2.3 /
*/ -->
<div class="atdemo-original">
@xy0
xy0 / ATDemo.html
Last active December 5, 2018 20:19
Preview code that is put into single elements without needing a dev enviroment
<!-- /*
/
/ \_|\ /
/ /
/ A-Train Marketing /
/ /
ATDemo 0.2.2 /
*/ -->
<div class="atdemo-original">
@xy0
xy0 / ATMC-custom-metabox.php
Last active August 17, 2018 21:17
ATMC-Custom-Metabox.php
<?php
/*
/
/ ATMC Custom Metabox /
/ /
/ A-Train Marketing /
/ /
Version 0.1.5 /
*/
@xy0
xy0 / jQuery-test.js
Created August 16, 2018 18:20
test for jQuery support
// test for jQuery
//
if ('undefined' == typeof window.jQuery) {
console.error('~jQuery is required')
} else {
(function($){
$(document).ready( function(){
// jQuery loaded
@xy0
xy0 / WPPlusMinusAccordion.js
Created January 17, 2018 16:16
Use JS to change + to - in your WP accordions.
$('.panel-heading').click(function(){
$('#ew-accordian').find('a').each(function(){
$(this).attr('data-before','+');;
});
if( $(this).find('a').attr('aria-expanded') == 'true' ) {
$(this).find('a').attr('data-before','+');
} else {
$(this).find('a').attr('data-before','-');
@xy0
xy0 / WidowWedder.js
Created October 31, 2017 20:02
Removes Widows (single words on a newline)
$(document).ready(function() {
widowWedderLauncher();
});
$(window).resize(function() {
widowWedderLauncher();
});
function widowWedderLauncher() {
$('.no-widow, h1, h2, h3, a').each( function(){
widowWedder( $(this) );
@xy0
xy0 / antiWidowMaker.js
Created October 20, 2017 15:38
Remove text widows - words that wrap by themselves
$(document).ready(function() {
$('.no-widow, h1, h2, h3, a').each( function(){
antiWidowMaker( $(this) );
});
});
$(window).resize(function() {
$('.no-widow, h1, h2, h3, a').each( function(){
antiWidowMaker( $(this) );
});
});
@xy0
xy0 / defaultUScript.js
Last active October 4, 2017 20:50
User Script Template
// ==UserScript== .
// @name XY0-defaultUserScript
// @namespace MESH.FYN.XY0.UScript
// @description F
// @include *
// @version 0.1
// @grant none
// ==/UserScript== .
console.log(' \n' ,
@xy0
xy0 / disable-context-menu
Created July 27, 2017 16:35
disable context menu (right-click) on a webpage
// document can just as easily be an element
document.oncontextmenu = function() {
return false;
};
@xy0
xy0 / slideout-css-only
Created July 10, 2017 20:13
slideout-css-only
<style type="text/css">
#slideout {
right: 0;
z-index:9001;
}
#slideout_inner {
right: -274px;
background-color:#f4f4f4;
width: 274px;
text-align:center;