Skip to content

Instantly share code, notes, and snippets.

View jasperf's full-sized avatar
🏠
Working from home

Jasper Frumau jasperf

🏠
Working from home
View GitHub Profile
@jasperf
jasperf / cpt-bootstrap-carousel.php
Last active November 15, 2015 12:02 — forked from jdcauley/carousel.php
Custom Post Type Slider to slide products, features and so on including the template for the custom post bootstrap slider as well as minimum needed CSS. This Custom Post Type Boostrap Slider has been forked from JDCauley's slider, adjusted and styled using http://goo.gl/Vd1ScP . #wordpress #bootstrap #wordpress

Contract Killer 3

Revised date: 07/11/2012

Between us [company name] and you [customer name]

Summary:

We’ll always do our best to fulfil your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. We’ve no desire to trick you into signing something that you might later regret. What we do want is what’s best for both parties, now and in the future.

@jasperf
jasperf / Inkscape.txt
Created September 27, 2015 09:00 — forked from lambdalisue/Inkscape.txt
How to convert px to pt in Inkscape font size
# How to convert font size px to pt in Inkscape
> Inkscape pixel is 1/90 of an inch, other software usually uses 1/72. This means if you need 10pt - use 12.5 in Inkscape (multiply with 1.25).
> http://www.inkscapeforum.com/viewtopic.php?f=6&t=5964
@jasperf
jasperf / gist:359ef87acaf6c0a99e61
Created October 27, 2015 11:44 — forked from hilios/gist:1284170
Nginx YSlow performance boost w/ Gzip + Far future expires Header
server {
# output compression saves bandwidth
gzip on;
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types text/plain text/html text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
# make sure gzip does not lose large gzipped js or css files
@jasperf
jasperf / functions.php
Created November 27, 2015 06:47 — forked from sunriseweb/functions.php
Makes Divi Pagebuilder work with Yoast SEO
//Enable shortcodes in WordPress SEO generated Meta Description with HTML removed
add_filter( 'wpseo_metadesc', 'am_enable_shortcodes_removed_html' ); //see https://yoast.com/wordpress/plugins/seo/api/
function am_enable_shortcodes_removed_html($metadesc) {
if( strpos($metadesc, 'et_pb_section') !== FALSE ) {
global $post;
$rendered_content = apply_filters('the_content', $post->post_content);
$newmetadesc = strip_tags( $rendered_content );
return substr($newmetadesc, 0, 156);
@jasperf
jasperf / Vagrantfile
Last active November 28, 2015 13:05 — forked from chiquitto/Vagrantfile
File with vagrant configs for php development for Zend Skeleton Application including MySQL #zend #vagrant #zendframework2
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = '2'
@script = <<SCRIPT
DOCUMENT_ROOT="/var/www/ZendSkeletonApplication/public"
#https://github.com/zendframework/ZendSkeletonApplication.git before running VagrantFile
MYSQL_ROOT_PASSWORD="123456"
#To reset root pw for MySQL See http://askubuntu.com/questions/489098/unable-to-reset-root-password-of-mysql
@jasperf
jasperf / gist:7b3a11672be76bf40baa
Last active February 14, 2016 05:46 — forked from allarmark/gist:a93368fd411d56932b99
Convert broken encoding of WordPress Posts, excerpts and Titles #wordpress #encoding
UPDATE wp_posts SET post_title =
CONVERT(BINARY CONVERT(post_title USING latin1) USING utf8);
UPDATE wp_posts SET post_content =
CONVERT(BINARY CONVERT(post_content USING latin1) USING utf8);
UPDATE wp_posts SET post_excerpt =
CONVERT(BINARY CONVERT(post_content USING latin1) USING utf8);
@jasperf
jasperf / README.md
Created February 16, 2016 11:51 — forked from magnetikonline/README.md
Setting Nginx FastCGI response buffer sizes.

Nginx FastCGI response buffer sizes

By default when Nginx starts receiving a response from a FastCGI backend (such as PHP-FPM) it will buffer the response in memory before delivering it to the client. Any response larger than the set buffer size is saved to a temporary file on disk. This process is also explained at the Nginx ngx_http_fastcgi_module page document page.

Since disk is slow and memory is fast the aim is to get as many FastCGI responses passing through memory only. On the flip side we don't want to set an excessively large buffer as they are created and sized on a per request basis (i.e. it's not shared memory).

The related Nginx options are:

@jasperf
jasperf / wget
Created June 29, 2016 01:55 — forked from bueckl/wget
Wget examples
#Spider Websites with Wget – 20 Practical Examples
Wget is extremely powerful, but like with most other command line programs, the plethora of options it supports can be intimidating to new users. Thus what we have here are a collection of wget commands that you can use to accomplish common tasks from downloading single files to mirroring entire websites. It will help if you can read through the wget manual but for the busy souls, these commands are ready to execute.
1. Download a single file from the Internet
wget http://example.com/file.iso
2. Download a file but save it locally under a different name
wget ‐‐output-document=filename.html example.com
@jasperf
jasperf / wp-config.php
Created July 2, 2016 04:56
WordPress: Set WordPress site URL in the config file instead of the database
<?php
// WordPress stores the site URL in the database by default (which I have never
// understood), and it's a pain to have to type out the UPDATE SQL or search in
// phpMyAdmin to change it. This is a simple way to put the URL into
// wp-config.php instead.
// Note that you will still need to update any URLs that appear in the content,
// especially when you copy a database from a development site to production:
// https://gist.github.com/davejamesmiller/a8733a3fbb17e0ff0fb5