This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Path = require('path'); | |
const CopyWebpackPlugin = require('copy-webpack-plugin'); | |
const Twig = require('twig'); | |
module.exports = { | |
mode: 'development', | |
entry: './src/app.js', | |
output: { | |
path: Path.join(__dirname, 'dist'), | |
filename: 'bundle.js' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { TweenLite } from 'gsap'; | |
const DEFAULT_DURATION = 0.3; | |
export const hideElement = (el, speed = DEFAULT_DURATION) => { | |
const oldSpacing = { height: el.clientHeight }; | |
const newSpacing = { height: 0 }; | |
const additionalSpacingProperties = ['paddingTop', 'paddingBottom', 'marginTop', 'marginBottom']; | |
additionalSpacingProperties.forEach(property => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict';(function(){var a=new DOMParser,b=document.querySelectorAll('img[data-svg-inline]');b.forEach(function(c){var d=c.src,e=c.parentNode;fetch(d).then(function(f){return f.text()}).then(function(f){var g=a.parseFromString(f,'image/svg+xml'),h=g.documentElement;e.replaceChild(h,c)})})})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin flexGridWithInsideBorders( $numberOfColumns, $borderColor: hsl(0, 0, 90%), $borderWidth: 1px, $borderStyle: solid, $numberOfItemsInLastRow: false) { | |
// Handle default numberOfItemsInLastRow | |
@if ( $numberOfItemsInLastRow == false ) { $numberOfItemsInLastRow: $numberOfColumns; } | |
// Setup the base flex grid | |
display: flex; | |
flex-wrap: wrap; | |
align-items: center; | |
justify-content: center; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Extracts the first page of the PDF | |
gs -dSAFER -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile="page1.pdf" -dFirstPage=1 -dLastPage=1 {pdf-file-name} | |
# Converts that 1 page PDF into a JPEG | |
convert "page1.pdf" {pdf-file-name}.jpg | |
# Delete the 1-page pdf | |
rm "page1.pdf" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('init', 'remove_comment_support', 100); | |
function remove_comment_support() { | |
// Remove post type support for each post type | |
foreach (get_post_types() as $post_type) { | |
if (post_type_supports( $post_type, 'comments' )) { | |
// Don't remove comment support for shop orders |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add contact | |
$donation->setContact( | |
$safe_data['contact-title'], | |
$safe_data['contact-firstname'], | |
$safe_data['contact-surname'], | |
$safe_data['addressline1'], | |
$safe_data['addressline2'], | |
$safe_data['suburb'], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin targetPlaceholderText { | |
&::-webkit-input-placeholder { @content; } | |
&:-moz-placeholder { @content; } // Firefox 18- | |
&::-moz-placeholder { @content; } // Firefox 19+ | |
&:-ms-input-placeholder { @content; } | |
} | |
// Usage example: | |
input { | |
@include targetPlaceholderText { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Gets the next post in the current post type, even if is last post | |
* Inspired from https://gist.github.com/banago/5603826 | |
* | |
* @method get_next_post_looped | |
* @return WordPress Post Object | |
*/ | |
function get_next_post_looped() { | |
$post_type = get_post_type(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
The following mixin works when @include[ed] onto a div containing three empty spans: | |
<div class="animated-hamburger"> | |
<span></span> | |
<span></span> | |
<span></span> | |
</div> | |
To get the animation on click, use the following JQuery: |