Skip to content

Instantly share code, notes, and snippets.

Avatar

Koen Rijpstra KoenRijpstra

View GitHub Profile
View laravel-forge-ngx-pagespeed.sh
PAGESPEED_VERSION=v1.12.34.2-stable
apt-get remove nginx nginx-full -y
apt-get install dpkg-dev build-essential zlib1g-dev libpcre3 libpcre3-dev -y
sed -i "s/# deb-src/deb-src/" /etc/apt/sources.list.d/nginx-ubuntu-development-xenial.list
apt-get update
apt-get build-dep nginx -y
cd /tmp
apt-get source nginx
View gist:257bbee5fa2f38fe3680
var list = document.querySelectorAll('h3.r a');
var output = "";
[].forEach.call(list, function(item) {
output += '"' + item.innerHTML + '","' + item.href + '"\n';
});
console.log(output);
@KoenRijpstra
KoenRijpstra / gist:55b6db2c4922216d7e64
Last active Aug 29, 2015
Copy Google results to clipboard
View gist:55b6db2c4922216d7e64
var results = document.querySelectorAll('#res li h3 a');
var results_body = '';
for(i=0;i < results.length;i++) {
results_body += '"' + results[i].innerHTML + '","' + results[i].href + '"\n';
}
copy(results_body);
@KoenRijpstra
KoenRijpstra / functions.php
Last active Aug 29, 2015
Disable pods_meta_handler
View functions.php
<?php
function my_pods_meta_handler() {
return false;
}
add_filter( 'pods_meta_handler', 'my_pods_meta_handler' );
View .gitignore
# 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
View wp_private_page_filters.php
/**
* Enable unpublished pages in page lists and dropdowns
*
* @param array $args
* @return array $args
*/
function scl_list_pages_args( $args ) {
$args['post_status'] = array( 'publish', 'private' );
return $args;
}
@KoenRijpstra
KoenRijpstra / index.php
Created Dec 19, 2013
Added taxonomy filter
View index.php
<?php
/**
* Plugin Name: Media Library Categories
* Plugin URI: http://wordpress.org/plugins/wp-media-library-categories/
* Description: Adds the ability to use categories in the media library.
* Version: 1.3
* Author: Jeffrey-WP
*/
/** register taxonomy for attachments */
View gist:7080235
.assistive-text {
left: 0;
position: absolute !important;
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
clip: rect(1px, 1px, 1px, 1px);
}