Skip to content

Instantly share code, notes, and snippets.

View iPublicis's full-sized avatar

Lopo iPublicis

View GitHub Profile
@iPublicis
iPublicis / site-title-smilies.php
Created February 17, 2016 16:13 — forked from westonruter/site-title-smilies.php
Selective refresh example plugin
<?php
/**
* Plugin name: Site Title (and Tagline) Smilies
* Description: Demonstration of selective refresh in the Customizer. Selectors are targeting elements in Twenty Fifteen.
* Author: Weston Ruter, XWP
* Plugin URL: https://gist.github.com/westonruter/a15b99bdd07e6f4aae7a
*
* @package SiteTitleSmilies
*/
@iPublicis
iPublicis / media-queries.scss
Created March 10, 2017 16:08 — forked from chrisl8888/media-queries.scss
All Media Queries breakpoints
@media (min-width:320px) { /* smartphones, portrait iPhone, portrait 480x320 phones (Android) */ }
@media (min-width:480px) { /* smartphones, Android phones, landscape iPhone */ }
@media (min-width:600px) { /* portrait tablets, portrait iPad, e-readers (Nook/Kindle), landscape 800x480 phones (Android) */ }
@media (min-width:801px) { /* tablet, landscape iPad, lo-res laptops ands desktops */ }
@media (min-width:1025px) { /* big landscape tablets, laptops, and desktops */ }
@media (min-width:1281px) { /* hi-res laptops and desktops */ }
@iPublicis
iPublicis / lookforbadguys.php
Last active October 30, 2017 02:29
Look For Bad Guys - Copyright (C) 2012 Karen Chun, Steven Whitney. Initially published by http://25yearsofprogramming.com. #PHP #Security
<?php
/* lookforbadguys.php 2012-04-09
Copyright (C)2012 Karen Chun, Steven Whitney.
Initially published by http://25yearsofprogramming.com.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License (GPL)
Version 3 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@iPublicis
iPublicis / Leetify.php
Created November 1, 2018 01:55 — forked from romanitalian/Leetify.php
Leetify: "leet "-> "133+"; "133+" -> "leet"
<?php
// The this code migrate to github project: https://github.com/romanitalian/Leetify
/**
* Class Leetify
* Leetify::encode('leet'); // "133+"
* Leetify::decode('133+'); // "leet"
*/
class Leetify
{
@iPublicis
iPublicis / xkcd-password.php
Created November 28, 2018 23:06 — forked from BinaryKitten/xkcd-password.php
xkcd-password-wordpress.php
<?php
/*
* Generate xkcd style password from /usr/share/dict/words
*
* http://xkcd.com/936/
* apt-get install wamerican
*/
if (!function_exists('wp_generate_password')) :
$filesize = @filesize('/usr/share/dict/words');
if ($filesize !== false):
@iPublicis
iPublicis / chmodr.sh
Created December 4, 2018 23:19 — forked from francisbyrne/chmodr.sh
Recursive chmod script for dirs and/or files
#!/bin/sh
#
# chmodr.sh
#
# author: Francis Byrne
# date: 2011/02/12
#
# Generic Script for recursively setting permissions for directories and files
# to defined or default permissions using chmod.
#
@iPublicis
iPublicis / cpanel_remove_all_email_accounts.sh
Last active December 6, 2018 13:47
cPanel mass delete e-mail accounts script
#!/bin/bash
##########################
#
# Taken from https://forums.cpanel.net/threads/mass-delete-e-mail-accounts-script.387802/
# Created by QuizKnows - https://forums.cpanel.net/members/quizknows.178313/
#
if [ -z $2 ]
then
@iPublicis
iPublicis / create_gif.sh
Created January 7, 2019 15:34 — forked from EmmanuelKasper/create_gif.sh
Create gif file with avconf
#export frames
avconv -i hatari.avi -vf fps=10 frames/ffout%03d.png
#assemble frames a gif
convert -loop 0 frames/ffout0*.png new.gif
@iPublicis
iPublicis / .htaccess
Created January 31, 2019 17:21 — forked from vielhuber/.htaccess
Apache: htaccess force www and https ssl #server
# force HTTPS and www.
RewriteEngine On
RewriteCond %{HTTP_HOST} (?!^www\.)^(.+)$ [OR]
RewriteCond %{HTTPS} off
RewriteRule ^ https://www.%1%{REQUEST_URI} [R=301,L]
# alternative way
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]