Skip to content

Instantly share code, notes, and snippets.

@djmtype
djmtype / reset.css
Created November 15, 2021 16:31
Piccalilli Reset
/* Box sizing rules */
*,
*::before,
*::after {
box-sizing: border-box;
}
/* Remove default margin */
body,
h1,
@keyframes smoothscroll1 {
from,
to {
scroll-behavior: smooth;
}
}
@keyframes smoothscroll2 {
from,
to {
@djmtype
djmtype / ad.php
Created July 30, 2020 19:29
AdSanity general ad template
<?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 );
@djmtype
djmtype / Index.vue
Created July 26, 2020 23:44
Spotify Gridsome
<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 / Posts.vue
Created May 15, 2020 19:53
Movie DB Query template and config
// 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 / acf-responsive-image.php
Last active September 25, 2018 16:31
ACF Responsive Image
<?php
$image = get_field('my_image');
if( !empty($image) ):
// vars
$size = 'large';
$url = $image['url'];
@djmtype
djmtype / cf7-validation.js
Last active June 16, 2017 22:08
Contact Form 7 validation
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 / gulpfile.js
Last active April 10, 2016 13:26
Sage Gulpfile with Bless
// ## 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');