Skip to content

Instantly share code, notes, and snippets.

Avatar

Richard Rudy thezenmonkey

View GitHub Profile
View tabs.json
{"version":"0.4","title":"Tab Test","type":"section","content":[{"id":"379e3f9a","settings":{"background_background":"classic","background_color":"#000000","background_image":{"url":"https:\/\/elementorhelp.me\/wp-content\/uploads\/2019\/04\/Abstract-lines-background-1027269126_4213x2370.jpg","id":77},"background_overlay_background":"classic","background_overlay_color":"rgba(0,0,0,0.97)","background_overlay_opacity":{"unit":"px","size":0.71,"sizes":[]},"heading_color":"#ffffff","color_text":"#ffffff","color_link":"#6ec1e4","color_link_hover":"#61ce70"},"elements":[{"id":"2309aae5","settings":{"_column_size":100},"elements":[{"id":"4e883033","settings":{"tabs":[{"tab_title":"A","tab_content":"<p>Lorem ipsum dolor amet fanny pack celiac VHS, truffaut fam letterpress next level scenester ethical wayfarers. Pok pok small batch banh mi pop-up ethical tofu intelligentsia. Man braid biodiesel roof party distillery. Prism direct trade ramps cray williamsburg. Whatever cray shabby chic, shaman street art keffiyeh sing
View _mixins.scss
@mixin fluid-type($properties, $min-vw, $max-vw, $min-value, $max-value) {
@each $property in $properties {
#{$property}: $min-value;
}
@media screen and (min-width: $min-vw) {
@each $property in $properties {
#{$property}: calc(#{$min-value} + #{strip-unit($max-value - $min-value)} * (100vw - #{$min-vw}) / #{strip-unit($max-vw - $min-vw)});
}
}
@thezenmonkey
thezenmonkey / date_shortcode.php
Created Apr 27, 2019
Simple Shortcode for Display Post Date
View date_shortcode.php
function get_post_date( $atts ) {
$a = shortcode_atts( array(
'format' => $atts['format']
), $atts );
if ( array_key_exists("format",$a) ) {
return get_the_date($a['format']);
} else {
return get_the_date('m dd, y');
}
@thezenmonkey
thezenmonkey / elementor-dragnon.json
Last active May 1, 2019
Elementor Template Dragon Post
View elementor-dragnon.json
{"version":"0.4","title":"Dragon Loop","type":"loop","content":[{"id":"3d82b84d","settings":{"content_width":{"unit":"px","size":800,"sizes":[]},"custom_css":"selector,\nselector .elementor-container {\n height: 100%;\n}\n\nselector .elementor-widget-wrap {\n flex-direction: column;\n}"},"elements":[{"id":"b7c8f20","settings":{"_column_size":100,"padding":{"unit":"em","top":"0","right":"0","bottom":"0","left":"0","isLinked":false}},"elements":[{"id":"7a718b9d","settings":{"_padding":{"unit":"em","top":"1","right":"1","bottom":"1","left":"1","isLinked":true},"__dynamic__":{"image":"[elementor-tag id=\"44f671a\" name=\"post-featured-image\" settings=\"%7B%22fallback%22%3A%7B%22url%22%3A%22https%3A%2F%2Felementorhelp.me%2Fwp-content%2Fuploads%2F2019%2F04%2F800x500.jpg%22%2C%22id%22%3A66%7D%7D\"]"}},"elements":[],"isInner":false,"widgetType":"image","elType":"widget"},{"id":"5b79180d","settings":{"structure":"20","background_background":"gradient","background_color":"rgba(255,255,255,0)","background_color_b
View foundational.yml
---
Name: foundational
After:
- 'DNADesign\Elemental'
- 'DNADesign\ElementalList'
---
SilverStripe\Core\Manifest\ModuleManifest:
module_priority:
- DNADesign\Elemental
- DNADesign\ElementalList
@thezenmonkey
thezenmonkey / PublishAllFiles.php
Last active May 18, 2018 — forked from a2nt/PublishAllFiles.php
SS3 > SS4.1 protected folder migration script
View PublishAllFiles.php
<?php
/*
* Generates FileHash and moves files to .protected folder
* Re-generates CMS thumbs on the second run and publish files
*/
use SilverStripe\Dev\BuildTask;
use SilverStripe\Control\Director;
use SilverStripe\Assets\File;
View SectionElement.php
<?php
use DNADesign\ElementalList\Model\ElementList;
class SectionElement extends ElementList
{
private static $db = [
'FullWidth' => 'Boolean'
];
private static $controller_template = 'NoElementHolder';
@thezenmonkey
thezenmonkey / vc_vonts.php
Created Apr 3, 2018
Visual Composer Overide Google Font List
View vc_vonts.php
add_filter('vc_google_fonts_get_fonts_filter','custom_fonts');
// $font_list from js_composer/include/params/google_fonts/google_fonts.php
function custom_fonts( $fonts_list ) {
$fonts_list = array();
$open_sans = new stdClass();
$open_sans->font_family = 'Open Sans';
$open_sans->font_styles = '300,300italic,regular,italic,600,600italic,700,700italic,800,800italic';
@thezenmonkey
thezenmonkey / AutosortBlocks.php
Created Nov 19, 2016
onAfterWrite function to auto incriment blocks
View AutosortBlocks.php
public function onAfterWrite()
{
parent::onAfterWrite();
if ($this->hasExtension('FilesystemPublisher')) {
$this->republish($this);
}
$currentPage = Controller::curr()->getRequest()->requestVar('CMSMainCurrentPageID');
// Check if Block is Used on Current Page and has a Sort of 0
$query = new SQLSelect();
@thezenmonkey
thezenmonkey / LeftAndMain.TranslateTo.js
Last active Jun 9, 2016
Javscript for Batch Translate
View LeftAndMain.TranslateTo.js
/*jslint browser: true, nomen: true, white: true */
/**
* Javascript to process extra batch actions. Currently deals with the TranslateTo action
*/
(function($) {
'use strict';
$.entwine('ss.tree', function($){