Skip to content

Instantly share code, notes, and snippets.

View soulreverie's full-sized avatar

Lydia soulreverie

View GitHub Profile
@soulreverie
soulreverie / gist:b05c8879fedb2402acae201d13d26f9d
Last active January 7, 2021 16:57
Wordrpess: Remove dnt from embedded vimeo video links
/**
* Wordrpess: Remove dnt from embedded vimeo video links
*/
function tdp_remove_embed_url_dnt($provider, $url, $args){
return add_query_arg( array('dnt' => false), $provider );
}
add_filter('oembed_fetch_url', 'tdp_remove_embed_url_dnt', 10, 3);
@soulreverie
soulreverie / functions.php
Created April 15, 2020 14:53 — forked from eristic/functions.php
Gulp file for using Gulp with Underscores theme. Place in root theme directory, saved as gulpfile.js
/*
This is taken directly from here and modified to fit our needs: https://developer.wordpress.org/themes/basics/including-css-javascript/
*/
function add_that_css_and_js() {
wp_enqueue_style( 'enqueue-that-css', get_template_directory_uri() . '/css/main.css', array(), '1.0', 'all');
wp_enqueue_script( 'enqueue-that-js', get_template_directory_uri() . '/js/min/main.min.js', array ( 'jquery' ), 1.0, true);
@soulreverie
soulreverie / wp-increase-timeout.php
Created October 18, 2019 13:11 — forked from sudar/wp-increase-timeout.php
Increase the curl timeout in WordPress
<?php
Copied from http://fatlabmusic.com/blog/2009/08/12/how-to-fix-wp-http-error-name-lookup-timed-out/
//adjustments to wp-includes/http.php timeout values to workaround slow server responses
add_filter('http_request_args', 'bal_http_request_args', 100, 1);
function bal_http_request_args($r) //called on line 237
{
$r['timeout'] = 15;
return $r;
}
@soulreverie
soulreverie / Wordrpess PDF Thumbnail Fix
Created February 1, 2019 19:57
Regenerates Thumbnail PDFs to ensure that PDFs without a background are filled with white and not black.
add_filter( 'wp_generate_attachment_metadata', 'tdp_create_pdf_thumbnail', 10, 2 );
function tdp_create_pdf_thumbnail( $metadata, $attachment_id ) {
//Get the attachment/post object
$attachment_obj = get_post( $attachment_id );
//Check for mime type pdf
if( 'application/pdf' == get_post_mime_type( $attachment_obj ) ) {
package org.firstinspires.ftc.teamcode;
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
import com.qualcomm.robotcore.hardware.DcMotor;
/*Autonomous Code:
This code is assuming that the left motor is mounted backwards. If the right motor is mounted
backwards, commend out the line motorLeft.setDirection(DcMotor.Direction.REVERSE); and un-commend
package org.firstinspires.ftc.teamcode;
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
import com.qualcomm.robotcore.hardware.DcMotor;
import com.qualcomm.robotcore.hardware.Servo;
/* ARM LIFT ALTERNATE : UNTESTED & NOT BUILT
----------------------------------------------------------
// detect IE
var IEversion = detectIE();
if (IEversion !== false) {
// document.getElementById('result').innerHTML = 'IE ' + IEversion;
document.getElementsByTagName("body")[0].classList.add("ie");
document.getElementsByTagName("body")[0].classList.add("ie" + IEversion);
} else {
// document.getElementById('result').innerHTML = 'NOT IE';
}
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your