Skip to content

Instantly share code, notes, and snippets.

@dsmy
dsmy / books-hover-animation.markdown
Created June 2, 2026 22:56
Books Hover Animation
@dsmy
dsmy / index.pug
Created June 2, 2026 22:51
Pure CSS 3D animated carousel - minimal code, heavily commented
- const DATA = [ //- just the image codes
- '1540968221243-29f5d70540bf',
- '1596135187959-562c650d98bc',
- '1628944682084-831f35256163',
- '1590013330451-3946e83e0392',
- '1590421959604-741d0eec0a2e',
- '1572613000712-eadc57acbecd',
- '1570097192570-4b49a6736f9f',
- '1620789550663-2b10e0080354',
- '1617775623669-20bff4ffaa5c',
@dsmy
dsmy / diagonal-slider-anime-js.markdown
Created June 2, 2026 22:49
Diagonal Slider - Anime.js
@dsmy
dsmy / custom-meta.php
Created July 31, 2018 02:55
Custom Blog meta with author name outside of WordPress loop
if ( ! function_exists( 'atmosphere_posted_on' ) ) :
/**
* Prints HTML with meta information for the current post-date/time and author.
*/
function atmosphere_posted_on() {
global $post;
$author_id = $post->post_author;
$author = get_the_author_meta('display_name', $author_id);
$time_string = '<time class="entry-date published updated" datetime="%1$s">%2$s</time>';
if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
@dsmy
dsmy / functions.php
Created October 31, 2017 18:59 — forked from yratof/functions.php
ACF OEmbed with thumbnails
<?php
/* Pull apart OEmbed video link to get thumbnails out*/
function get_video_thumbnail_uri( $video_uri ) {
$thumbnail_uri = '';
// determine the type of video and the video id
$video = parse_video_uri( $video_uri );
// get youtube thumbnail
@dsmy
dsmy / gulpfiles.js
Created October 28, 2016 15:30
roots.io with gulp.js
'use strict';
// TODO: better timing and size informations
// TODO: add sass sourcemaps
// TODO: bower wiredep
var gulp = require('gulp');
var del = require('del');
var $$ = require('gulp-load-plugins')();
@dsmy
dsmy / AutoCopyrightUpdate.php
Created November 16, 2015 16:03
Auto update copyright in footer with error protection
<!--Referenced from https://css-tricks.com/snippets/php/automatic-copyright-year/-->
<!--Start date with error protection-->
<?php function auto_copyright($year = 'auto'){ ?>
<?php if(intval($year) == 'auto'){ $year = date('Y'); } ?>
<?php if(intval($year) == date('Y')){ echo intval($year); } ?>
<?php if(intval($year) < date('Y')){ echo intval($year) . ' - ' . date('Y'); } ?>
<?php if(intval($year) > date('Y')){ echo date('Y'); } ?>
<?php } ?>
@dsmy
dsmy / customwoocartclass.php
Created April 1, 2015 20:16
Custom Class if Item is in Cart Woocommerce
<?php
global $woocommerce;
// Extra post classes
$classes = array();
if ( 0 == ( $woocommerce_loop['loop'] - 1 ) % $woocommerce_loop['columns'] || 1 == $woocommerce_loop['columns'] )
$classes[] = 'first';
if ( 0 == $woocommerce_loop['loop'] % $woocommerce_loop['columns'] )
$classes[] = 'last';
// If item is in cart add this class
foreach($woocommerce->cart->get_cart() as $cart_item_key => $values ) {
@dsmy
dsmy / my_custom_admin_columns.php
Created March 30, 2015 07:43
additional data in admin columns
// Display additional data in admin columns for testimonials section
function my_testimonials_columns($columns)
{
$columns = array(
'cb' => '<input type="checkbox" />',
'title' => 'Title',
'testimonialType' => 'Testimonial Type',
'videoID' => 'Video ID',
'author' => 'Author',
'date' => 'Date',