Skip to content

Instantly share code, notes, and snippets.

View cbirdsong's full-sized avatar

Cory Birdsong cbirdsong

View GitHub Profile
@victusfate
victusfate / watercanvas.js
Created June 11, 2011 14:07
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
*/
@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
*/
@slightlyoff
slightlyoff / shortcodes_snippet.js
Created December 4, 2020 04:59
picture shortcodes
// Phil Hawksworth's Netlify LMS <picture> img generator
let getPicture = (url, alt="Missing alt text", width, height, style) => {
let w = width ? width : "500";
let w_attr = width ? `width="${width}"` : "";
let h_attr = height ? `height="${height}"` : "";
let s_attr = style ? `style="${style}"` : "";
return `<picture>
<source
media="(min-width: 1200px)"
property defaultAccountName : "iCloud"
property defaultFolderName : "Saved iCloud Tabs"
global html
global processedURLs
on appendLineWithURLItem(urlItem)
my appendHTML(" <li>")
my appendHTML("<a href=\"" & |url| of urlItem & "\">")
my appendHTML(|Title| of urlItem)
@dwhenson
dwhenson / .stylelintrc.json
Created July 1, 2021 11:43
Stylelint Config
{
"plugins": ["stylelint-order", "stylelint-scss"],
"defaultSeverity": "warning",
"rules": {
"at-rule-empty-line-before": [
"always",
{
"except": ["blockless-after-same-name-blockless", "first-nested"],
"ignore": ["after-comment", "first-nested", "blockless-after-same-name-blockless"]
}
@vegaskev
vegaskev / functions.php
Created July 20, 2018 22:05
Change Gravity Forms Spinner to CSS Spinner
// Changes Gravity Forms Ajax Spinner (next, back, submit) to a transparent image
// this allows you to target the css and create a pure css spinner like the one used below in the style.css file of this gist.
add_filter( 'gform_ajax_spinner_url', 'spinner_url', 10, 2 );
function spinner_url( $image_src, $form ) {
return 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'; // relative to you theme images folder
}
@gaambo
gaambo / acf.js
Last active December 29, 2021 18:11
ACF Block with Innerblocks
import { Fragment } from "@wordpress/element";
import { InnerBlocks } from "@wordpress/editor";
/**
* Changes the edit function of an ACF-block to allow InnerBlocks
* Should be called like this on `editor.BlockEdit` hook:
* ` addFilter("editor.BlockEdit", "namespace/block", editWithInnerBlocks("acf/block-name"));`
*
* @param {string} blockName the name of the block to wrap
* @param {object} innerBlockParams params to be passed to the InnerBlocks component (like allowedChildren)
@jaredatch
jaredatch / functions.php
Last active February 28, 2022 22:04
WordPress Search Autocomplete using WP REST API v2
<?php
/**
* Enqueue scripts and styles.
*
* @since 1.0.0
*/
function ja_global_enqueues() {
wp_enqueue_style(
'jquery-auto-complete',
@cdils
cdils / gutenberg-style.css
Created May 9, 2018 13:48
This is an unminified version of the stylesheet that ships with the WordPress Gutenberg plugin. Original SCSS files are here -> https://github.com/WordPress/gutenberg/tree/master/core-blocks
.wp-block-embed figcaption {
margin-top: .5em;
color: #6c7781;
text-align: center;
font-size: 13px
}
.editor-block-list__block[data-type="core/embed"][data-align=left] .editor-block-list__block-edit,
.editor-block-list__block[data-type="core/embed"][data-align=right] .editor-block-list__block-edit,
.wp-block-embed.alignleft,
@alexander-young
alexander-young / functions.php
Created January 15, 2020 05:27
Cleanup WordPress plugin admin
// Removing plugin controls from admin
function remove_plugin_controls($actions, $plugin_file, $plugin_data, $context){
if (array_key_exists('edit', $actions)) {
unset($actions['edit']);
}
if (array_key_exists('deactivate', $actions)) {