Skip to content

Instantly share code, notes, and snippets.

@djmtype
djmtype / gulpfile.js
Last active Apr 10, 2016
Sage Gulpfile with Bless
View gulpfile.js
// ## Globals
var argv = require('minimist')(process.argv.slice(2));
var autoprefixer = require('gulp-autoprefixer');
var browserSync = require('browser-sync').create();
var changed = require('gulp-changed');
var concat = require('gulp-concat');
var flatten = require('gulp-flatten');
var gulp = require('gulp');
var gulpif = require('gulp-if');
var imagemin = require('gulp-imagemin');
@djmtype
djmtype / cf7-validation.js
Last active Jun 16, 2017
Contact Form 7 validation
View cf7-validation.js
on_submit: "$(document).ajaxComplete(function() {$('#modalResponse').modal({backdrop: 'static', keyboard: false});$('#modalResponse .modal-body').html('<div class="alert alert-danger"><p>'+data.message+'</p></div>');}); $('.wpcf7-response-output').ajaxComplete(function(){$(this).delay(3000).fadeOut('slow');});"
@djmtype
djmtype / acf-responsive-image.php
Last active Sep 25, 2018
ACF Responsive Image
View acf-responsive-image.php
<?php
$image = get_field('my_image');
if( !empty($image) ):
// vars
$size = 'large';
$url = $image['url'];
@djmtype
djmtype / Posts.vue
Created May 15, 2020
Movie DB Query template and config
View Posts.vue
// Posts.vue template
<template>
<Layout>
<div class="markdown-body">
<h1>{{ $page.post.title }}</h1>
{{ $page.post.content }}
{{ $page.post.popularity }}
<br />
{{ $page.post.genre_ids }}
@djmtype
djmtype / Index.vue
Created Jul 26, 2020
Spotify Gridsome
View Index.vue
<template>
<div>
<h1 v-html="$page.oneGraph.spotify.me.id" />
<ul>
<li v-for="(item, index) in $page.oneGraph.spotify.me.playlists" :key="index">
<g-link :to="item.externalUrls.spotify">{{item.name}}</g-link>
<img :src="item.images[0].url" :height="300" :width="300" />
</li>
</ul>
@djmtype
djmtype / ad.php
Created Jul 30, 2020
AdSanity general ad template
View ad.php
<?php
if ( ! defined( 'ABSPATH' ) ) { die( 'You are not allowed to call this file directly.' ); }
global $post;
$ad_id = get_the_ID();
$ad_target = get_post_meta( $ad_id, '_target', true );
$ad_permalink = get_permalink( $ad_id );
$ad_size = get_post_meta( $ad_id, '_size', true );
You can’t perform that action at this time.