Skip to content

Instantly share code, notes, and snippets.

Stefan Pretty pretty

Block or report user

Report or block pretty

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@amboutwe
amboutwe / yoast_seo_meta_remove_dates.php
Last active Jul 31, 2019
Remove Date Meta Tags Output by Yoast SEO
View yoast_seo_meta_remove_dates.php
<?php
/********* DO NOT COPY THE PARTS ABOVE THIS LINE *********/
/* Remove Date Meta Tags Output by Yoast SEO
* Credit: Yoast development team
* Last Tested: Apr 09 2019 using Yoast SEO 10.1.3 on WordPress 5.1.1
*/
add_action('wpseo_dc_'.'DC.date.issued', '__return_false'); // older Premium versions only
add_filter( 'wpseo_og_article_published_time', '__return_false' );
@sproogen
sproogen / ChildComponent.vue
Last active Oct 30, 2019
Vee Validate - Child Component Example
View ChildComponent.vue
<template>
<div>
<input v-validate data-rules="required" :class="{'has-error': errors.has("textInput")}" id="textInput" name="textInput" type="text">
<span class="error" v-show="errors.has("textInput")">{{ errors.first("textInput") }}</span>
</div>
</template>
<script>
import { find, propEq } from 'ramda'
import bus from './bus'
@orottier
orottier / retry.php
Last active Oct 31, 2019
Retry function for PHP with exponential backoff
View retry.php
<?php
/*
* Retry function for e.g. external API calls
*
* Will try the risky API call, and retries with an ever increasing delay if it fails
* Throws the latest error if $maxRetries is reached,
* otherwise it will return the value returned from the closure.
*
* You specify the exceptions that you expect to occur.
@emilysnothere
emilysnothere / add_action.php
Last active Sep 17, 2019
Adding fields to the WordPress post submit box
View add_action.php
add_action('post_submitbox_misc_actions', createCustomField);
add_action('save_post', saveCustomField);
@Vestride
Vestride / encoding-video.md
Last active Nov 12, 2019
Encoding video for the web
View encoding-video.md

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
@iansltx
iansltx / _safari-iframe-cookie-workaround.md
Last active Oct 2, 2019
Safari iframe cookie workaround
View _safari-iframe-cookie-workaround.md
@martindrapeau
martindrapeau / jquery.cach-inputs.js
Created Dec 27, 2013
jQuery plugin to cache HTML inputs using local storage. Restores them upon next page load.
View jquery.cach-inputs.js
// Cache user inputs into HTML5 local storage. Restore them upon next page load.
// Usage:
// $('body').CacheInputs();
//
// Will store stringified JSON in local storage, against the key you specify
// or 'cache-inputs' if you omit it. See settings below.
//
// Author: Martin Drapeau
//
// Greatly inspired from Johnathan Schnittger
@cou929
cou929 / detect-private-browsing.js
Last active Jul 15, 2019
Detect private browsing mode (InPrivate Browsing or Incognito).
View detect-private-browsing.js
function retry(isDone, next) {
var current_trial = 0, max_retry = 50, interval = 10, is_timeout = false;
var id = window.setInterval(
function() {
if (isDone()) {
window.clearInterval(id);
next(is_timeout);
}
if (current_trial++ > max_retry) {
window.clearInterval(id);
@Xeoncross
Xeoncross / ajax.js
Last active Oct 15, 2019
Simple, cross-browser Javascript POST/GET xhr request object. Supports request data and proper AJAX headers.
View ajax.js
/**
* IE 5.5+, Firefox, Opera, Chrome, Safari XHR object
*
* @param string url
* @param object callback
* @param mixed data
* @param null x
*/
function ajax(url, callback, data, x) {
try {
@tleen
tleen / gist:6395808
Created Aug 31, 2013
Javascript array of Canadian Provinces
View gist:6395808
['Alberta', 'British Columbia', 'Manitoba', 'New Brunswick', 'Newfoundland and Labrador', 'Northwest Territories', 'Nova Scotia', 'Nunavut', 'Ontario', 'Prince Edward Island', 'Quebec', 'Saskatchewan', 'Yukon Territory']
You can’t perform that action at this time.