Skip to content

Instantly share code, notes, and snippets.

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

Sean cybersholt

🏠
Working from home
View GitHub Profile
"a",
"able",
"about",
"above",
"abroad",
"according",
"accordingly",
"across",
"actually",
"adj",
@cybersholt
cybersholt / functions.php
Created April 18, 2017 22:23
Clear wp cache on save or update
<?php
function clear_cache_c() {
wp_cache_clear_cache();
}
add_action( 'publish_post', 'clear_cache_c', 10, 2 );
add_action( 'post_updated', 'clear_cache_c', 10, 3 );
?>
@cybersholt
cybersholt / bbparser.php
Last active May 13, 2017 23:04
Uddeim BBcode Bug
<?php
function uddeIMbbcode_replace( $string, $config ) {
if ( $config->allowbb > 0 ) {
// replace font formatting [b] [i] [u] [color= [size=
// bold
$string = preg_replace( "/(\[b\])(.*?)(\[\/b\])/si", "<span style=\"font-weight: bold\">\\2</span>", $string );
// underline
@cybersholt
cybersholt / cfban.php
Created May 31, 2017 02:11 — forked from andrieslouw/cfban.php
Cloudflare V4 PHP API - block / unblock IP in firewall
<?php
/**
* @author https://github.com/andrieslouw
* @copyright 2016
**/
function cfban($ipaddr){
$cfheaders = array(
'Content-Type: application/json',
'X-Auth-Email: your@email.com',
@cybersholt
cybersholt / screen.md
Created June 14, 2017 17:54 — forked from fredrick/screen.md
GNU Screen Cheat Sheet

#GNU Screen Cheat Sheet

##Basics

  • ctrl a c -> cre­ate new win­dow
  • ctrl a A -> set win­dow name
  • ctrl a w -> show all win­dow
  • ctrl a 1|2|3|… -> switch to win­dow n
  • ctrl a " -> choose win­dow
  • ctrl a ctrl a -> switch between win­dow
  • ctrl a d -> detach win­dow
@cybersholt
cybersholt / 404.html
Created June 20, 2017 15:46 — forked from hank789/404.html
Trying to secure Nginx the most for Joomla CMS under Ubuntu 11.10
<!-- to be saved at /usr/share/nginx/html/404.html -->
<html lang="en"><head><meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, minimum-scale=1, width=device-width">
<title>Error 404 (Not Found)!!1</title>
<style>
*{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}
</style>
<link type="text/css" rel="stylesheet" href="chrome-extension://cpngackimfmofbokmjmljamhdncknpmg/style.css"><script type="text/javascript" charset="utf-8" src="chrome-extension://cpngackimfmofbokmjmljamhdncknpmg/page_context.js"></script></head><body screen_capture_injected="true">
<!--
@cybersholt
cybersholt / css-media-queries-cheat-sheet.css
Created June 20, 2017 20:28 — forked from bartholomej/css-media-queries-cheat-sheet.css
CSS Media Query Cheat Sheet (with Foundation)
/*------------------------------------------
Responsive Grid Media Queries - 1280, 1024, 768, 480
1280-1024 - desktop (default grid)
1024-768 - tablet landscape
768-480 - tablet
480-less - phone landscape & smaller
--------------------------------------------*/
@media all and (min-width: 1024px) and (max-width: 1280px) { }
@media all and (min-width: 768px) and (max-width: 1024px) { }
@cybersholt
cybersholt / jQuery.ajaxRetry.js
Created September 1, 2017 19:03 — forked from yairEO/jQuery.ajaxRetry.js
jQuery AJAX smart retry
// enhance the original "$.ajax" with a retry mechanism
$.ajax = (($oldAjax) => {
// on fail, retry by creating a new Ajax deferred
function check(a,b,c){
var shouldRetry = b != 'success' && b != 'parsererror';
if( shouldRetry && --this.retries > 0 )
setTimeout(() => { $.ajax(this) }, this.retryInterval || 100);
}
return settings => $oldAjax(settings).always(check)
@cybersholt
cybersholt / install_php71_centos.sh
Created December 7, 2017 22:45 — forked from jniltinho/install_php71_centos.sh
Install PHP 7.1 on CentOS 7.3
#!/bin/bash
### Install PHP 7.1 on CentOS 7.3 64Bits
### http://www.shaunfreeman.name/compiling-php-7-on-centos/
### https://www.howtoforge.com/tutorial/how-to-install-php-7-on-debian/
yum -y install git gcc gcc-c++ libxml2-devel pkgconfig openssl-devel bzip2-devel curl-devel libpng-devel libjpeg-devel
yum -y install libXpm-devel freetype-devel gmp-devel libmcrypt-devel mariadb-devel aspell-devel recode-devel libpqxx-devel
yum -y install autoconf bison re2c libicu-devel libwebp-devel wget unzip net-tools libc-client-devel libpng12-devel
yum -y install libxslt-devel
@cybersholt
cybersholt / install_pagespeed_nginx.sh
Created December 7, 2017 22:46 — forked from jniltinho/install_pagespeed_nginx.sh
How to Install Nginx and Google PageSpeed on Debian/Ubuntu
#!/bin/bash
## Install PageSpeed on Debian 8/9 and Ubuntu 16.04 64Bits
## https://www.howtoforge.com/tutorial/how-to-install-nginx-and-google-pagespeed-on-ubuntu-16-04/
## http://nginx.org/en/linux_packages.html
## https://www.modpagespeed.com/doc/build_ngx_pagespeed_from_source
## https://developers.google.com/speed/pagespeed/module/
## Debian ISO: https://cdimage.debian.org/cdimage/archive/8.9.0/amd64/iso-cd/
## No Link abaixo tem o pacote do Nginx para o Debian 8 64Bits
## https://github.com/jniltinho/ispconfig/tree/master/packages/debian/jessie
## Run as root (sudo su)