Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
<?php | |
/** | |
* Download a large distant file to a local destination. | |
* | |
* This method is very memory efficient :-) | |
* The file can be huge, PHP doesn't load it in memory. | |
* | |
* /!\ Warning, the return value is always true, you must use === to test the response type too. | |
* | |
* @author dalexandre |
<?php | |
/* | |
* PHP: Recursively Backup Files & Folders to ZIP-File | |
* MIT-License - 2012-2018 Marvin Menzerath | |
*/ | |
// Make sure the script can handle large folders/files | |
ini_set('max_execution_time', 600); | |
ini_set('memory_limit', '1024M'); |
// Set sizes without units | |
$basefont: 20; | |
$total-width-px: 1169; | |
$column-width-px: 72; | |
// Concatenation of units by addition results in conversion to string. This is bad | |
$basefont-px: $basefont+'px'; // = "20px" | |
// Conversion to pixels using multiplication | |
$basefont-px: $basefont*1px; // = 20px; |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
<?php | |
/** | |
* Display how many spots are left in the choice label when using the GP Limit Choices perk | |
* http://gravitywiz.com/gravity-perks/ | |
*/ | |
add_filter( 'gplc_remove_choices', '__return_false' ); | |
add_filter( 'gplc_pre_render_choice', 'my_add_how_many_left_message', 10, 5 ); |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Example</title> | |
<link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/jquery.slick/1.3.6/slick.css"/> | |
<style> | |
.menu { | |
text-align: center; | |
} |
<?php | |
// Credit to http://joshuaiz.com/words/ordering-events-by-advanced-custom-fields-date-time-picker-field/ | |
$time = current_time( 'timestamp' ); // Get current unix timestamp | |
// Set up custom query with meta_query to compare event start date with today's date | |
$args = array ( | |
'post_type' => 'event', // your event post type slug | |
'post_status' => 'publish', // only show published events | |
'orderby' => 'meta_value', // order by date |
var countryCodes = { | |
'Afghanistan': '93', | |
'Albania': '355', | |
'Algeria': '213', | |
'American Samoa': '684', | |
'Andorra': '376', | |
'Angola': '244', | |
'Antigua and Barbuda': '1-268', | |
'Argentina': '54', | |
'Armenia': '374', |
// This function implements a "Load More" button. | |
// It assumes that there is already a matching query that has executed on the page, so this AJAX call is just a continuation of that query to grab additional posts. | |
// There are no animations added here. For a smoother experience, it is a good idea to add animations to the button (ex. a loading icon during the request), or making the new posts animate in (ex, using Animate.css to fade them into the page) | |
$(function() { | |
// Grab the load more button, since I only want to run the code if the button is on the page | |
var loadMoreButton = $('#load-more'); | |
if (loadMoreButton) { | |
// Because there are already posts on the page, we need to manually tell this query what page of results to grab so that is doesn't load duplicate posts | |
var loadPosts = function(page) { |
<?php | |
$args = array( | |
'label' => '', // Text in Label | |
'class' => '', | |
'style' => '', | |
'wrapper_class' => '', | |
'value' => '', // if empty, retrieved from post meta where id is the meta_key | |
'id' => '', // required | |
'name' => '', //name will set from id if empty |