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 / functions.php
Last active January 23, 2018 12:45
Function to prevent orphans in WordPress post titles. It simply replaces the last space after the penultimate word of a title by a non-breaking space. Pfew.
function add_nonbreaking_space_to_text($title, $id = null){
$title = explode(' ', $title);
$length = count($title);
if( $length >0){
$title[ $length-2 ] .= " " . $title[ $length-1 ];
array_pop($title);
}
return implode(" ", $title);
}
@fiskhandlarn
fiskhandlarn / custom-search-acf-wordpress.php
Last active April 17, 2024 06:52 — forked from jserrao/custom-search-acf-wordpress.php
PHP - Wordpress - Search - wordpress custom search function that encompasses ACF/advanced custom fields and taxonomies and split expression before request. I updated this original script with better documentation and XSS / SQL injection support.
<?php
/*
##############################
########### Search ###########
##############################
Included are steps to help make this script easier for other to follow
All you have to do is add custom ACF post types into Step 1 and custom taxonomies into Step 10
I also updated this work to include XSS and SQL injection projection
[list_searcheable_acf list all the custom fields we want to include in our search query]
@pixeline
pixeline / siege-urls.php
Last active January 23, 2018 12:45
WP-siege: Generates list of all published URLs from a Wordpress site, for use with Siege.
<?php
/*
*
* WP-siege: Generates list of all published URLs from a Wordpress site, for use with Siege.
* Author: Alexandre Plennevaux [email protected]
*
*/
//path to a wp-load file
include( './wp-load.php' );
@pixeline
pixeline / _sassy_link_underlines.md
Last active June 11, 2016 14:57 — forked from jimmynotjim/_sassy_link_underlines.md
Sassy Link Underlines
@gchtr
gchtr / Acf_Current_Tab.php
Last active January 25, 2017 17:10
WordPress + ACF: Keep the last edited tab selection when post refreshes
<?php
// Drop this into your functions.php
/**
* ACF: Keep the last edited tab selection when post refreshes.
*
* When a post containing ACF tabs is opened for edits, the currently selected tab
* will be saved in a transient. Upon save or refresh of the page, the last selected
* tab will be selected again, making it more convenient to work with ACF tabs.
@jeromecoupe
jeromecoupe / base_creative_meeting_plan.md
Last active May 10, 2016 14:11
Outline for the Creative Meeting introduction @ Base Design - May 11, 2016

Communicating design in a digital environment

Before getting into the matter, I wanted to set the stage. We are essentially going to talk about three things today.

  1. The context of digital design
  2. Problematic static design deliverables
  3. Design deliverables and the current digital workflow

The context: dealing with unknown unknowns

@hollodotme
hollodotme / Install-nginx-with-http2-support.md
Created April 9, 2016 17:07
Install nginx with http2 support on ubuntu 14.04 LTS (Trusty)

How to install nginx (>= 1.9.5) with http2 support on Ubuntu 14.04 LTS (Trusty)

IMPORTANT: Backup your nginx site configs (usually under /etc/nginx/sites-available)!

Remove old nginx

Remove old nginx incl. nginx-common:

apt-get autoremove --purge nginx nginx-common
@zlorb
zlorb / linux_fun.md
Last active February 14, 2025 00:33 — forked from marianposaceanu/linux_fun.md
How to have some fun using the terminal.

Linux fun-o-matic

How to have some fun using the terminal.

  1. Install cowsay [0] via : sudo apt-get install cowsay
  2. Install fortune [1] via : sudo apt-get install fortune
  3. Install figlet [3] via : sudo apt-get install figlet
  4. Make sure you have Ruby installed via : ruby -v
  5. Install the lolcat [2] via : gem gem install lolcat
  6. (option) Add to .bash_profile and/or .bashrc
@nucliweb
nucliweb / fortune-cowsay-lolcat.md
Last active March 12, 2025 14:04
fortune | cowsay | lolcat

fortune | cowsay | lolcat

Install Brew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install fortune

brew search fortune
<?php
# Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
# http://creativecommons.org/publicdomain/zero/1.0/
function postToMedium($data=array()) {
$user_id = "XXXX";
$accessToken = "XXXX";