Skip to content

Instantly share code, notes, and snippets.

View joshuaiz's full-sized avatar
💭
it iz what it iz

Joshua Michaels joshuaiz

💭
it iz what it iz
View GitHub Profile
@joshuaiz
joshuaiz / soundcloud_mixin.scss
Created February 12, 2014 21:57
A SCSS @mixin for styling custom SoundCloud widgets
// Here's a little mixin I created to style some custom SoundCloud players
// $size = the size of the arwork box (also size of margins for track info + waveform)
// $title-color = the color of the track title
// $waveform-color = color of the audio waveform
// $play-color = color of the player indicator bar (current track position in playback)
//
// Usage: @include scplayer (60px, #001825, #aaa, #777)
@mixin scplayer($size, $title-color, $waveform-color, $play-color) {
@jayhill90
jayhill90 / launch.json
Created April 17, 2020 17:34
XDebug Configuration file for VSCode and Local by Flywheel
{
// Set your VSCode Workspace root to the root folder of your Local site.
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
@scottopolis
scottopolis / zip-clean-alias.sh
Last active May 28, 2020 20:27
ZSH alias to zip current folder, remove git and DS Store files, and show in finder
# put this in your .zshrc file, change path to store zip, restart terminal
# run command `releasezip my-files-1.0`, which would create a zip at ../my-files-1.0.zip
# change output path (../) to whatever you want, for example Users/Me/Plugins/Releases/$1.zip
releasezip() {
zip -r ../$1.zip . -x '*.git*' --exclude=\*.DS_Store\*
open ../
}
@ridinghoodmedia
ridinghoodmedia / functions.php
Last active July 5, 2020 21:03
Populate Envira Gallery with ACF gallery field
/*
* Populate Envira Gallery with ACF gallery field
*
* Filters the gallery $data and replaces with the image data for our images in the ACF gallery field.
*
* @uses ACF Pro
* @uses Envira Gallery
* @param $data
* @param $gallery_id
*/
@galengidman
galengidman / index.php
Created March 28, 2014 19:01
get ACF image size URL by ID
<?php
// first, get the image ID returned by ACF
$image_id = get_field('my_image_field');
// and the image size you want to return
$image_size = 'thumbnail';
// use wp_get_attachment_image_src to return an array containing the image
// we'll pass in the $image_id in the first parameter
@jeffquach
jeffquach / Shopify verify theme support
Last active January 3, 2023 00:30
Sample code: https://shopify.dev/apps/online-store/verify-support contains bugs. The code should be checking `templateJSONFiles.length > 0` but doesn't. The gist also doesn't not use Shopify's node library and HTTP requests are made to Shopify's REST API using node-fetch, but any HTTP library can be used instead
const fetch = require('node-fetch');
try {
// Specify the name of the template the app will integrate with
const APP_BLOCK_TEMPLATES = ['product', 'collection'];
const getOptions = { method: 'GET', headers: { 'X-Shopify-Access-Token': accessToken } };
// Get published theme
const themeResponse = await fetch(`https://${shop}/admin/api/${API_VERSION}/themes.json`, getOptions);
this.checkError(themeResponse, 'ThemeFetchFailure');
@shopifypartners
shopifypartners / a-beginners-guide-to-sass-part-3-interpolation.liquid.scss
Last active February 13, 2023 08:04 — forked from stewartknapman/style.liquid.scss
A Beginner's Guide to Sass with Shopify — Part 3: Sass interpolation, Workflow and Object Oriented CSS - https://www.shopify.com/partners/blog/a-beginners-guide-to-sass-with-shopify-part-3
// Escaping Liquid in SCSS.
//
// Expected output:
// a{
// color: {{ settings.link-color }};
// }
a{
color: #{'{{ settings.link-color }}'};
}
@wpchannel
wpchannel / mu-yoast-seo-disable-notifications.php
Last active April 16, 2023 08:33
Hide annoying notifications after each upgrade of Yoast SEO plugin and others admin notices
<?php if (!defined('ABSPATH')) die('Restricted Area');
/*
* Plugin Name: Disable Yoast SEO Notifications
* Description: Hide annoying notifications after each upgrade of Yoast SEO plugin and others admin notices.
* Version: 1.1
* Author: Aurélien Denis
* Author URI: https://wpchannel.com/
*/
@joshuacerbito
joshuacerbito / useScroll.js
Last active January 8, 2024 13:44
Custom React hook for listening to scroll events
/**
* useScroll React custom hook
* Usage:
* const { scrollX, scrollY, scrollDirection } = useScroll();
*/
import { useState, useEffect } from "react";
export function useScroll() {
const [lastScrollTop, setLastScrollTop] = useState(0);
@leepettijohn
leepettijohn / functions.php
Last active January 11, 2024 23:16
Add Event to The Events Calendar from a Gravity Form
//The following section is an add-on to this tutorial - https://tri.be/gravity-forms-events-calendar-submissions/
//Shout to CreativeSlice.com for their initial work
/* Before Starting:
- Make sure you have these three plugins installed
- Gravity Forms
- The Events Calendar
- Gravity Forms + Custom Post Types
- Once Gravity Forms is installed, create a form with these fields
- Single Line Text (Event Title)
- Paragraph Text (Event Description)