Skip to content

Instantly share code, notes, and snippets.

View yratof's full-sized avatar
🍊
Eating an orange

Andrew yratof

🍊
Eating an orange
View GitHub Profile
@yratof
yratof / functions.php
Created March 25, 2015 16:43
Advanced Custom Fields - Update Gallery with Gravity Forms
$gravity_form_id = 6; // gravity form id, or replace {$gravity_form_id} below with this number
add_filter("gform_after_submission_{$gravity_form_id}", 'jdn_set_post_acf_gallery_field', 10, 2);
function jdn_set_post_acf_gallery_field($entry, $form)
{
$gf_images_field_id = 42; // the upload field id
$acf_field_id = 'field_54804833b3067'; // the acf gallery field id
// get post
@yratof
yratof / console.sh
Created April 21, 2015 09:56
Remove Youtube Adverts
document.cookie="VISITOR_INFO1_LIVE=oKckVSqvaGw; path=/; domain=.youtube.com";window.location.reload();
@yratof
yratof / gist:cf763dac16020fbf2709
Created April 30, 2015 15:45
Stop jQuery from being cached with page speed
# Deny Pagespeed form accessing jquery. This fucks things up.
ModPagespeedDisallow "*/jquery.js"
@yratof
yratof / functions.php
Created May 6, 2015 12:23
AJAX with Wordpress
<?php
function ajax_function_for_doing_something(){
echo 'This is AJAX!';
die(); // All ajax functions MUST die. otherwise they never give results back
}
// Add the ajax hooks for when you're logged in
add_action( 'wp_ajax_DO_SOMETHING', 'ajax_function_for_doing_something' );
// Add the ajax hooks for front end when not logged in
@yratof
yratof / clients.php
Last active August 29, 2015 14:20
MU Plugin for Clients
<?php
/*
Plugin Name: Stop touching my files
Plugin URI: http://eyeversuseye.com
Description: This stops you touching my files. I'm sick of you doing it. SICK OF IT!
Author: Andrew Lazarus
Version: Unlimited.
Author URI: http://eyeversuseye.com
Notes: Stop touching my files and then
@yratof
yratof / footer.html
Last active August 29, 2015 14:21
Target that fucking Android Stock Browser
@yratof
yratof / wordpress.sh
Created May 22, 2015 13:45
Installing a new meat wordpress
# Installing Wordpress with CLI
cd your/website/folder
# Download Wordpress
wp core download
# setup the cofig with database, user and pass
wp core config --dbname="DATABASE" --dbuser="root" --dbpass="root"
# install wordpress with URL, NAME, USERNAME and PASSWORD
wp core install --url="WORDPRESS_URL" --title="WORDPRESS_NAME" --admin_user="Full Phat Design" --admin_password="Full Phat Design" --admin_email="[email protected]"
# Install woocommerce, yoast and meat theme
wp plugin install woocommerce --activate
@yratof
yratof / scripts.js
Last active August 29, 2015 14:22
Notifications when you click on contact page...
// Notifications – LOL
window.addEventListener('load', function () {
// At first, let's check if we have permission for notification
// If not, let's ask for it
if (window.Notification && Notification.permission !== "granted") {
Notification.requestPermission(function (status) {
if (Notification.permission !== status) {
Notification.permission = status;
}
});
@yratof
yratof / functions.php
Created June 2, 2015 12:35
Getting the Video ID from ACF OEmbed, then using that ID to call in videos without bloat
<?php
/* Parse the video uri/url to determine the video type/source and the video id */
function parse_video_uri( $url ) {
// Parse the url
$parse = parse_url( $url );
// Set blank variables
$video_type = '';
$video_id = '';
@yratof
yratof / index.html
Last active August 29, 2015 14:22
Sticky Footer using Flexbox
<div class="container">
<div class="content">
<!-- Any amount of content here -->
</div>
<footer>
<!-- This will always be in the footer now. -->
</footer>
</div>