Skip to content

Instantly share code, notes, and snippets.

View pietromalerba's full-sized avatar

Pietro Malerba pietromalerba

  • M3
  • Civitanova Marche (MC) - Italy
View GitHub Profile
@pietromalerba
pietromalerba / clear-font-cache.md
Created September 29, 2017 09:58 — forked from jaredhowland/clear-font-cache.md
Clear Mac OS X Font Caches
@pietromalerba
pietromalerba / .htaccess
Last active December 11, 2017 14:31 — forked from Jany-M/.htaccess
[WP] htacces for best security & caching settings
# ------------------------------------------------------------------------------------------
#
# CUSTOM SETUP
#
# ------------------------------------------------------------------------------------------
# MAINTENANCE-PAGE REDIRECT
#<IfModule mod_rewrite.c>
# RewriteEngine on
# RewriteCond %{REMOTE_ADDR} !^123\.456\.789\.000
@pietromalerba
pietromalerba / happy_git_on_osx.md
Created January 10, 2018 14:28 — forked from trey/happy_git_on_osx.md
Creating a Happy Git Environment on OS X

Creating a Happy Git Environment on OS X

Step 1: Install Git

brew install git bash-completion

Configure things:

git config --global user.name "Your Name"

git config --global user.email "[email protected]"

@pietromalerba
pietromalerba / heart.js
Created January 29, 2018 09:35 — forked from paulirish/heart.js
sweetass heart canvas.
// 99% done by @rauri rochford
// http://js1k.com/2012-love/demo/1071
// i just rAF'd it.
// demo at http://bl.ocks.org/1823634
e = [];// trails
#!/bin/bash
# variables
LOGFILE="/var/log/nginx/access.log"
LOGFILE_GZ="/var/log/nginx/access.log.*"
RESPONSE_CODE="200"
# functions
filters(){
grep $RESPONSE_CODE \
@pietromalerba
pietromalerba / blockClicks.js
Created February 17, 2019 10:51 — forked from lucas-pelton/blockClicks.js
Prevent multiple clicks and submissions in Contact Form 7
//http://epsiloncool.ru/programmirovanie/preventing-multiple-submits-in-contact-form-7
jQuery(document).on('click', '.wpcf7-submit', function(e){
if( jQuery('.ajax-loader').hasClass('is-active') ) {
e.preventDefault();
return false;
}
});
@pietromalerba
pietromalerba / gist:bd562c389a4d84cc8e4439290e930743
Created April 9, 2019 06:18 — forked from Synchro/gist:3749394
PHP script to report and/or extract sections from apache and icecast log files by date ranges
#!/usr/bin/env php
<?php
/**
* Extract a section of an apache or icecast log file between two dates
* Assumes that log lines are in chronological order
* Start and end dates can be in any format that strtotime can handle
* Reads from stdin, outputs to stdout, stats to stderr
* @author Marcus Bointon <[email protected]>
* @link https://gist.github.com/3749394
* Example usage. Report the range of dates in a log file
@pietromalerba
pietromalerba / find-base64-occurences
Created June 5, 2019 04:09 — forked from anotheremily/find-base64-occurences
hackers seem to like base64 encoding their php commands
#!/bin/bash
find . -name "*.php" -exec grep "base64" '{}' \; -print &> b64-detections.txt
find . -name "*.php" -exec grep "eval" '{}' \; -print &> eval-detections.txt
@pietromalerba
pietromalerba / bitbucket-pipeline-pull-files.md
Created June 9, 2023 16:35 — forked from shankar-bavan/bitbucket-pipeline-pull-files.md
CI CD with bitbucket pipleline and shell script