Skip to content

Instantly share code, notes, and snippets.

View DESIGNfromWITHIN's full-sized avatar

Menno Pietersen DESIGNfromWITHIN

View GitHub Profile
@DESIGNfromWITHIN
DESIGNfromWITHIN / Gulpfile.js
Last active March 4, 2021 21:00
Gulpfile.js example Uses browser-sync, node-neat, gulp and gulp-sass
/*
Gulpfile.js file for the tutorial:
Using Gulp, SASS and Browser-Sync for your front end web development - DESIGNfromWITHIN
http://designfromwithin.com/blog/gulp-sass-browser-sync-front-end-dev
Steps:
1. Install gulp globally:
npm install --global gulp
$.fn.setAllToMaxHeight = function(){
return this.height( Math.max.apply(this, $.map( this , function(e){ return $(e).height() }) ) );
}
// usage: $(‘div.unevenheights’).setAllToMaxHeight();
@DESIGNfromWITHIN
DESIGNfromWITHIN / gist:6609045
Created September 18, 2013 13:19
Flexibility 4 meta tag options
[[*flex_socialType:notempty=`
<meta property="og:type" content="[[*flex_socialType]]">
`]]
[[*flex_socialType:isequalto=`book`:then=`
<meta property="book:author" content="[[*flex_socialAuthorUrl]]">
`]]
[[*flex_socialType:isequalto=`article`:then=`
<meta property="article:author" content="[[*flex_socialAuthorUrl]]">
`]]
<meta property="og:title" name="twitter:title" content="[[*pagetitle]]">
@DESIGNfromWITHIN
DESIGNfromWITHIN / index.html
Last active December 19, 2015 21:19
A CodePen by Menno Pietersen.
<span data-picture data-alt="GlarusSafe image" class="v4_landing_cta_bg_image">
<span data-src="[[!getSiteURL]]assets/images/GlarusSafe/GlarusSafe_s.jpg"></span>
<span data-src="[[!getSiteURL]]assets/images/GlarusSafe/GlarusSafe_m.jpg" data-media="(min-width: 500px)"></span>
<span data-src="[[!getSiteURL]]assets/images/GlarusSafe/GlarusSafe_l.jpg" data-media="(min-width: 768px)"></span>
<span data-src="[[!getSiteURL]]assets/images/GlarusSafe/GlarusSafe_xl.jpg" data-media="(min-width: 980px)"></span>
<span data-src="[[!getSiteURL]]assets/images/GlarusSafe/GlarusSafe_xxl.jpg" data-media="(min-width: 1200px)"></span>
<!--[if (lt IE 9) & (!IEMobile)]>
<img src="[[!getSiteURL]]assets/images/GlarusSafe/GlarusSafe_l.jpg" alt="GlarusSafe image">
<![endif]-->
<!-- Fallback content for non-JS browsers. Same img src as the initial, unqualified source element. -->
@DESIGNfromWITHIN
DESIGNfromWITHIN / MODX - Wayfinder call with all options
Created May 7, 2013 09:06
A MODX Wayfinder call with all options and defaults listed.
[[Wayfinder?
&startId=`0`
&displayStart=`0`
&level=`0`
&ignoreHidden=`0`
&ph=`0`
&debug=`0`
&hideSubMenus=`0`
&removeNewLines=`0`
&textOfLinks=`menutitle`
@DESIGNfromWITHIN
DESIGNfromWITHIN / gist:68c905ce692d62b0047e
Last active December 13, 2015 23:12
addContent.rersolver.php
<?php
$sources = array(
'data' => $modx->getOption('core_path') . 'components/cosmos/contentResources/',
);
$addContent = $modx->getOption('add_content', $options, false);
if ($addContent) {
$resources = include $sources['data'] . 'transport.resources.php';
foreach ($resources as $resource) {
$modx->log(xPDO::LOG_LEVEL_INFO,'Installing content');
$resource->save();
@DESIGNfromWITHIN
DESIGNfromWITHIN / index.html
Created October 29, 2012 10:09
A CodePen by Menno Pietersen.
<div id="responsive_div">
<h1>This is a responsive div</h1>
</div>
@DESIGNfromWITHIN
DESIGNfromWITHIN / optimized.html
Created September 18, 2012 19:22 — forked from opengeek/optimized.html
Example of optimizing conditional filters using a Chunk wrapper
[[[[*page-image:notempty=`$wrapImgThumb? &src=`*page-image` &alt=`[[*pagetitle]]` &thumbOpts=`w=480&h=320``]]]]
@DESIGNfromWITHIN
DESIGNfromWITHIN / index.html
Created July 5, 2012 14:42
A web page created at CodePen.io
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Nice CTA button without images &middot; CodePen</title>
<style>
@DESIGNfromWITHIN
DESIGNfromWITHIN / gist:7fe27d6305cd23edfd83
Created December 11, 2014 20:56
resolve.clientconfig.php
<?php
/**
* Subpackage Resolver file for cosmos extra
*
* Copyright 2014 by Menno Pietersen info@themesmodx.com
* Created on 12-11-2014
*
* @package cosmos
* @subpackage build
*/