Skip to content

Instantly share code, notes, and snippets.

View pixeline's full-sized avatar
😄
Heaven, I'm in heaven, And my heart beats so that I can hardly speak !

Alexandre Plennevaux pixeline

😄
Heaven, I'm in heaven, And my heart beats so that I can hardly speak !
View GitHub Profile
@pixeline
pixeline / create-hosting-user (Apache2)
Last active March 23, 2022 17:20
Create Hosting User script, for easy Apache web hosting administration.
#!/bin/bash
# script useful to create hosting user accounts for Apache.
# It creates the system user, its home folder and the virtualhost
# Enter a dummy password if you wish to attach domain to an existing user.
: '
USAGE
$ bash /home/pixeline/bin/create-hosting-user username password domain.tld
Arguments:
@ericakfranz
ericakfranz / functions.php
Created April 19, 2015 23:00
Filter WP SEO's OpenGraph and Twitter image meta tags
<?php
/**
* Return 'medium' image for mobile devices since that is what we're
* loading to display as the featured image on each post.
*/
//* Filter WP SEO's OpenGraph image output
add_filter('wpseo_opengraph_image_size', 'disi_opengraph_image_size');
function disi_opengraph_image_size($val) {
if( wp_is_mobile() ) {
@davidhund
davidhund / pragmatic-touch-icons.md
Last active September 4, 2020 15:42
Pragmatic Touch Icons

NOTE I'm trying to find the most optimal fav/touch icon setup for my use-cases. Nothing new here. Read Mathias Bynens' articles on re-shortcut-icon and touch icons, a FAQ or a Cheat Sheet for all the details.

I'd like to hear how you approach this: @valuedstandards or comment on this gist.

The issue

You have to include a boatload of link elements pointing to many different images to provide (mobile) devices with a 'favicon' or 'touch icon':

![Touch Icon Links](https://o.twimg.com/2/proxy.jpg?t=HBj6AWh0dHBzOi8vcGhvdG9zLTYuZHJvcGJveC5jb20vdC8yL0FBRGFGY1VRN1dfSExnT3cwR1VhUmtaUWRFcWhxSDVGRjNMdXFfbHRJWG1GNFEvMTIvMjI3OTE2L3BuZy8xMDI0eDc2OC8yL18vMC80L1NjcmVlbnNob3QlMjAyMDE1LTA0LTE0JTIwMTYuNTYuMjYucG5nL0NNejBEU0FCSUFJZ0F5Z0JLQUkvNGR1eDZnMzZmYnlzYWI3

@sparkweb
sparkweb / gist:c6a5a21ab44a23589b9c
Last active September 18, 2021 15:54
Order Desk PHP Client
<?php
class OrderDeskApiClient
{
private $store_id;
private $api_key;
private $base_url = "https://app.orderdesk.me/api/v2";
public $last_status_code = "";
public function __construct($store_id, $api_key) {
@butlerblog
butlerblog / test_wp_mail.php
Last active August 25, 2019 03:25
File for testing the wp_mail function http://b.utler.co/9L
<?php
/**
* This file can be used to validate that the WordPress wp_mail() function is working.
* To use, change the email address in $to below, save, and upload to your WP root.
* Then browse to the file in your browser.
*
* For full discussion and instructions, see the associated post here:
* http://b.utler.co/9L
*
* Author: Chad Butler
@pixeline
pixeline / purge.php
Last active January 23, 2018 12:45
Clears serverside caches (finetuned for wordpress on gandi.net simplehosting instances): Varnish, APC, WP Transients, WP Super Cache, W3 Total Cache
<?php
/* purge.php
* Clears serverside caches (finetuned for wordpress on gandi.net simplehosting instances): Varnish, APC, WP Transients, WP Super Cache, W3 Total Cache
*/
header("Cache-Control: max-age=1"); // don't cache ourself
error_reporting(E_ALL);
ini_set("display_errors", 1);
@jimmynotjim
jimmynotjim / _sassy_link_underlines.md
Last active October 6, 2020 15:44
Sassy Link Underlines
@pixeline
pixeline / ajax-handler-wp.php
Last active October 5, 2022 13:09
Custom ajax handler for Wordpress. Using admin-ajax.php, as is usually recommended, is very slow and does not allow the use of plugin shortcodes. Using a custom ajax handler like this bypasses that. http://wordpress.stackexchange.com/questions/170808/the-content-shows-shortcode-instead-of-parsing-it
<?php
/*
WORDPRESS SPECIFIC AJAX HANDLER (because admin-ajax.php does not render plugin shortcodes).
by alexandre@pixeline.be
credits: Raz Ohad https://coderwall.com/p/of7y2q/faster-ajax-for-wordpress
*/
//mimic the actual admin-ajax
define('DOING_AJAX', true);
if (!isset( $_REQUEST['action']))
@bendc
bendc / removeDuplicates.js
Last active February 5, 2021 16:57
Remove duplicates from array
function removeDuplicates(arr) {
var clean = []
var cleanLen = 0
var arrLen = arr.length
for (var i = 0; i < arrLen; i++) {
var el = arr[i]
var duplicate = false
for (var j = 0; j < cleanLen; j++) {
@jamesmusgrave
jamesmusgrave / _smart-underline.scss
Last active September 24, 2019 17:57
Smart Underline Sass Mixin
@mixin smart-underline($background: #fff, $text: #000, $selection: #ffc, $position: 86%){
a {
color: inherit;
text-decoration: none;
background: -webkit-linear-gradient($background, $background), -webkit-linear-gradient($background, $background), -webkit-linear-gradient($text, $text);
background-size: .05em 1px, .05em 1px, 1px 1px;
background-repeat: no-repeat, no-repeat, repeat-x;
text-shadow: 0.03em 0 $background, -0.03em 0 $background, 0 0.03em $background, 0 -0.03em $background, 0.06em 0 $background, -0.06em 0 $background, 0.09em 0 $background, -0.09em 0 $background, 0.12em 0 $background, -0.12em 0 $background, 0.15em 0 $background, -0.15em 0 $background;
background-position-y: $position,$position, $position;
background-position-x: 0%, 100%, 0%;