Skip to content

Instantly share code, notes, and snippets.

View agustinprosperi's full-sized avatar

Agustin Prosperi agustinprosperi

View GitHub Profile
<?php
if (!isset($_GET['url'])) {
?>
<!DOCTYPE html>
<meta charset="utf-8">
<title>Youtube RSS creator</title>
<form>
<p>Create an RSS feed for the videos on the following page:
<p><input name="url" placeholder="E.g. https://www.youtube.com/user/scishow/videos" style="width: 30em">
@-webkit-keyframes bgcolor { 0% { background-color: #ffccf2; }
50% { background-color: #ccffcc; }
100% { background-color: #ccffff; } }
@-moz-keyframes bgcolor { 0% { background-color: #ffccf2; }
50% { background-color: #ccffcc; }
100% { background-color: #ccffff; } }
@-ms-keyframes bgcolor { 0% { background-color: #ffccf2; }
50% { background-color: #ccffcc; }
@mixin box-shadow($top, $left, $blur, $color, $inset: false) {
@if $inset {
-webkit-box-shadow:inset $top $left $blur $color;
-moz-box-shadow:inset $top $left $blur $color;
box-shadow:inset $top $left $blur $color;
} @else {
-webkit-box-shadow: $top $left $blur $color;
-moz-box-shadow: $top $left $blur $color;
box-shadow: $top $left $blur $color;
}
@agustinprosperi
agustinprosperi / woocommerce-composites-wpml-fix.php
Last active September 1, 2015 10:02
If you are using WPML with WooCommerce Multilingual, WooCommerce & Composite Products and get an error when attempting to add a Composite to your cart, this snippet might fix the issue.
<?php
/**
* Plugin Name: WooCommerce Composite Products - WPML Cart Error Fix
* Plugin URI: http://www.woothemes.com/products/composite-products/
* Description: If you are using WPML with WooCommerce Multilingual, WooCommerce & Composite Products and get an error when attempting to add a Composite to your cart, this snippet might fix the issue.
* Version: 1.1
* Author: Manos Psychogyiopoulos
* Author URI: http://www.somewherewarm.net/
*
* Requires at least: 3.8
@agustinprosperi
agustinprosperi / ipn-test.php
Last active September 21, 2015 10:15 — forked from mikejolley/ipn-test.php
Quick snippet/plugin/dropin to test IPN support
<?php
/**
* Plugin Name: PayPal Sandbox IPN Tester
* Description: Pings the IPN endpoint to see if your server can connect. Just head to <a href="/?ipn-test=1">yoursite.com/?ipn-test=1</a> whilst logged in as admin.
* Version: 1.0.0
* Author: WooThemes
* Requires at least: 4.1
* Tested up to: 4.3
*/
if ( ! defined( 'ABSPATH' ) ) {
@agustinprosperi
agustinprosperi / change_featured_image_labels.php
Last active April 29, 2016 07:55 — forked from slushman/gist:454cc8b26c330727df13
Customize the Featured Image labels
@agustinprosperi
agustinprosperi / getWeek.js
Created February 10, 2016 15:59 — forked from dblock/getWeek.js
get week of the year in JavaScript
function( d ) {
// Create a copy of this date object
var target = new Date(d.valueOf());
// ISO week date weeks start on monday
// so correct the day number
var dayNr = (d.getDay() + 6) % 7;
// Set the target to the thursday of this week so the
@agustinprosperi
agustinprosperi / rename-uploads.php
Created September 19, 2016 11:34 — forked from onnimonni/rename-uploads.php
Remove accents from Wordpress uploads. This renames all files and replaces corresponding attachment in WordPress database. You probably use linux in production and might run OS X in development. This helps to avoid possible problems with filenames. To avoid this in future install mu-plugin which hooks in 'sanitize_file_name'
<?php
/*
* Replace-uploads.php
* This replaces all accents from your uploads
* you can run this with wp-cli: $ wp eval-file replace-uploads.php
*/
/**
* cd to right path before changes
*/
@agustinprosperi
agustinprosperi / wp_get_current_page_url.php
Created January 3, 2017 17:06 — forked from leereamsnyder/wp_get_current_page_url.php
In WordPress, get current URL including query string
<?php
/**
Re-use some existing WordPress functions so you don't have to write a bunch of raw PHP to check for SSL, port numbers, etc
Place in your functions.php (or re-use in a plugin)
If you absolutely don't need or want any query string, use home_url(add_query_arg(array(),$wp->request));
Hat tip to:
+ http://kovshenin.com/2012/current-url-in-wordpress/