Skip to content

Instantly share code, notes, and snippets.

@arelthia
arelthia / 0_reuse_code.js
Created December 23, 2013 17:54
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@arelthia
arelthia / gfs3.php
Created December 28, 2016 19:43 — forked from renventura/gfs3.txt
Send Gravity Forms file uploads to Amazon S3
<?php
/**
* Send Gravity Forms file uploads to Amazon S3
* @author Ren Ventura <EnageWP.com>
* @link http://www.engagewp.com/send-gravity-forms-file-uploads-to-amazon-s3/
*/
//* Include the required library
include_once 'inc/S3.php';
<?php
function my_customize_rest_cors() {
remove_filter( 'rest_pre_serve_request', 'rest_send_cors_headers' );
add_filter( 'rest_pre_serve_request', function( $value ) {
header( 'Access-Control-Allow-Origin: *' );
header( 'Access-Control-Allow-Methods: GET' );
header( 'Access-Control-Allow-Credentials: true' );
header( 'Access-Control-Expose-Headers: Link', false );