Skip to content

Instantly share code, notes, and snippets.

@jakebellacera
jakebellacera / ICS.php
Last active July 26, 2024 07:48
A convenient script to generate iCalendar (.ics) files on the fly in PHP.
<?php
/**
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
@liquidzym
liquidzym / watercanvas.js
Created June 11, 2011 14:22 — forked from victusfate/watercanvas.js
water canvas by Almer Thie http://code.almeros.com
/*
* Water Canvas by Almer Thie (http://code.almeros.com).
* Description: A realtime water ripple effect on an HTML5 canvas.
* Copyright 2010 Almer Thie. All rights reserved.
*
* Example: http://code.almeros.com/code-examples/water-effect-canvas/
* Tutorial: http://code.almeros.com/water-ripple-canvas-and-javascript
*/
@stuross
stuross / gist:1649731
Created January 20, 2012 21:35
hack to fill gaps in masonry
/**
* jQuery Masonry v2.1.01
* A dynamic layout plugin for jQuery
* The flip-side of CSS Floats
* http://masonry.desandro.com
*
* Licensed under the MIT license.
* Copyright 2011 David DeSandro
*/
@melissacabral
melissacabral / wp-dimox-breadcrumbs.php
Last active February 17, 2022 09:13
breadcrumbs - place in functions.php and call in your theme with dimox_breadcrumbs() [Source](http://dimox.net/wordpress-breadcrumbs-without-a-plugin/)
<?php
/**
* Dimox Breadcrumbs
* http://dimox.net/wordpress-breadcrumbs-without-a-plugin/
* Since ver 1.0
* Add this to any template file by calling dimox_breadcrumbs()
* Changes: MC added taxonomy support
*/
function dimox_breadcrumbs(){
/* === OPTIONS === */
@codescribblr
codescribblr / video-functions.php
Created February 17, 2014 21:35
functions related to video embeds in wordpress
<?php
# This file contains functions that are related with videos
#
# Filters/resizes video embed codes.
#
function filter_video($html, $wmode = false, $width = false, $height = false) {
$final_html = $html;
if ($wmode) {
if (strpos($final_html, 'iframe') !== FALSE && strpos($final_html, 'youtube') !== FALSE) {
@radiovisual
radiovisual / custom-wordpress-gallery-output.php
Last active September 27, 2022 04:44
Create custom wordpress gallery output
@Jany-M
Jany-M / wp_ics.php
Last active September 19, 2023 03:15 — forked from jakebellacera/ICS.php
[WP] Generate a downloadable .ics file from any WordPress post or custom post type
<?php
/*
For a better understanding of ics requirements and time formats
please check https://gist.github.com/jakebellacera/635416
*/
// UTILS
// Check if string is a timestamp
@jaredatch
jaredatch / functions.php
Last active July 3, 2023 23:10
WordPress Search Autocomplete using admin-ajax.php
<?php
/**
* Enqueue scripts and styles.
*
* @since 1.0.0
*/
function ja_global_enqueues() {
wp_enqueue_style(
'jquery-auto-complete',
@thangman22
thangman22 / register.js
Created April 1, 2018 07:21
Workbox for Wordpress
async function addToCache(urls) {
const pageCache = await window.caches.open('page-cache');
await pageCache.addAll(urls);
}
// Check that service workers are registered
if ('serviceWorker' in navigator) {
// Use the window load event to keep the page load performant
window.addEventListener('load', () => {
addToCache(['/hello-world/', '/main-page/']);