Skip to content

Instantly share code, notes, and snippets.

View emaildano's full-sized avatar
🏄‍♀️
Surfing the information superhighway

Dano emaildano

🏄‍♀️
Surfing the information superhighway
  • Philadelphia, PA
View GitHub Profile
@emaildano
emaildano / acf-field-counter.php
Created May 28, 2014 20:15
ACF field counter snippet.
<?php
// get the count on the repeater field
// mabye use get_sub_field() instead of get_field() if it's nested
$count = count( get_sub_field( 'the_field' ) );
// begin $count conditions
if ( $count > 1 ) { ?>
// greater than 1
<?php the_field( 'great_than_1' ); ?>
<?php } else { ?>

Covert MK4 to MP4 for iTunes and AirPlay

ffmpeg -i foo.mkv -codec copy bar.mp4
ffmpeg -i input.mkv -c:v copy -c:a aac -b:a 384k output.mp4
@emaildano
emaildano / cloudflare-amimoto-cloudfront.md
Created October 2, 2019 18:12
Cloudflare to Amimoto CloudFront

Whitelist Headers

Default (*)

Authorization
CloudFront-Forwarded-Proto
CloudFront-Is-Desktop-Viewer
CloudFront-Is-Mobile-Viewer
CloudFront-Is-Tablet-Viewer
<div>
<style>
.contact-form__btn {
background-color: #207786;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
"use strict";
module.exports.run = () => {
const axios = require("axios");
axios
.post("https://api.getshifter.io/v1/login", {
username: process.env.USERNAME,
password: `${process.env.PASSWORD}`
})
{
"type": "package",
"package": {
"name": "beaver-builder/bb-plugin",
"type": "wordpress-plugin",
"version": "<VERSION_NUMBER>",
"dist": {
"type": "zip",
"url": "https://updates.wpbeaverbuilder.com/?fl-api-method=composer_download&download=bb-plugin-<VERSION>.zip&license=<LICENSE_KEY>"
},
<?php
/*
Plugin Name: Column Shortcodes
Version: 1.0
Description: Adds shortcodes to easily create columns in your posts or pages
Author: Codepress
Author URI: https://www.admincolumns.com/
Plugin URI: https://wordpress.org/plugins/column-shortcodes
Text Domain: column-shortcodes
<?php
/**
* This code is intended to be added to your wp-config.php file just below the top comment block.
* It should replace the existing define('DB_*') statements. You can add or remove sections
* depending on the number of environments you intend to setup. You should change all values of
* DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST for each environment, making them all distinct
* for security purposes.
*/
// determine the current environment
@emaildano
emaildano / group-by-tax.php
Created March 9, 2014 15:48
Group posts by taxonomy.
<?php
$get_current_cat = get_term_by('name', single_cat_title('',false), 'category');
$current_cat = $get_current_cat->term_id;
// List posts by the terms for a custom taxonomy of any post type
$post_type = 'special_events';
$tax = 'locations';
$tax_terms = get_terms( $tax, 'orderby=name&order=ASC');
if ($tax_terms) {