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 / _underline.scss
Last active July 6, 2016 19:18 — forked from jamesmusgrave/_smart-underline.scss
Smart Underline Sass Mixin
// dev note: make sure to use an autoprefixer...
@mixin underline($background: #fff, $text: #000, $selection: #ffc, $position: 86%){
color: inherit;
text-decoration: none;
background: linear-gradient($background, $background), linear-gradient($background, $background), 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;
@pixeline
pixeline / functions.php
Last active August 13, 2018 13:37
Generates metatags for wordpress
<?php
add_filter( 'customer', 'return_customer_info', 10, 1 );
function return_customer_info( $arg = '' ) {
/*
usage: echo apply_filters('customer', 'facebook');
*/
$customer = array(
'name' => 'Customer Name',
'facebook'=> 'https://www.facebook.com/customer',
@pixeline
pixeline / virtualhost_le_template (Apache)
Last active October 10, 2019 05:52
virtualhost template to use for sites ssl-ed via letsencrypt.org
<VirtualHost *:80>
ServerAdmin template.email
ServerName template.url
ServerAlias www.template.url
DocumentRoot template.webroot
<Directory template.webroot>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
@pixeline
pixeline / mirror_remote_directory_to_local_directory
Last active May 21, 2024 19:36
Bash script using lftp to mirror remote directory to local directory, thus keeping the local directory synchronized with the remote one.
#!/bin/sh
# @author: Alexandre Plennevaux
# @description: MIRROR DISTANT FOLDER TO LOCAL FOLDER VIA FTP
#
# FTP LOGIN
HOST='sftp://ftp.domain.com'
USER='ftpusername'
PASSWORD='ftppassword'
# DISTANT DIRECTORY
@pixeline
pixeline / Scale - zoom transition (jquery plugin)
Last active December 14, 2015 14:00
Scale - zoom transition (jquery plugin)
Scale - zoom transition (jquery plugin)
---------------------------------------
Simple jquery plugin that create a "zoom into" animation, especially good for anchors, to visually express that the link will lead to "more information". A [Pen](http://codepen.io/pixeline/pen/bVZGrM) by [pixeline](http://codepen.io/pixeline) on [CodePen](http://codepen.io/).
[License](http://codepen.io/pixeline/pen/bVZGrM/license).
;(function(defaults, $, window, document, undefined) {
'use strict';
$.extend({
// Function to change the default properties of the plugin
// Usage:
// jQuery.pluginSetup({property:'Custom value'});
pluginSetup : function(options) {
<?php
//ini_set('display_errors',1);
//error_reporting(E_ALL | E_WARNING);
function is_valid_url($url){
$url = filter_var($url, FILTER_SANITIZE_URL);
return filter_var($url, FILTER_VALIDATE_URL);
}
/* RUNTIME */
@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:
@pixeline
pixeline / curl
Last active May 6, 2022 14:29
Fetch an external page via Curl. Useful to bypass SAMEORIGIN issues.
<?php
/*
Fetch a quote from http url for a https site (avoids the insecure network error).
usage: this-script.php?url=http://johndoe.com
*/
/**
* Get a web file (HTML, XHTML, XML, image, etc.) from a URL. Return an
@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);