Skip to content

Instantly share code, notes, and snippets.

View salvatorecapolupo's full-sized avatar
🎯
Focusing

Salvatore Capolupo salvatorecapolupo

🎯
Focusing
View GitHub Profile
@salvatorecapolupo
salvatorecapolupo / Software free per la fatturazione
Last active November 8, 2018 12:05
Un elenco di soluzioni web per la fatturazione, pratici e veloci.
Cosa trovate in rete di free o open source per quello che riguarda la fatturazione, fatturazione inversa, scorporo dell'IVA e calcolo delle fatture da lordo, netto ed imponibile.
@salvatorecapolupo
salvatorecapolupo / gist:5c23e37800ee2d529bf222c504f60eaa
Created November 25, 2018 16:05
Bookmark principali siti sportivi
Per segnalazioni e richieste di rimozione scrivere a s.capolupo@gmail.com
Python, Perl and PHP open source HTML parsers. Useful for HTML traversing, parsing and scraping.
deny from all
allow from YOUR_IP_ADDRESS
@salvatorecapolupo
salvatorecapolupo / open-graph.html
Last active August 18, 2019 08:44
Facebook Open Graph HTML basic template
<meta property="og:locale" content="it_IT" />
<meta property="og:type" content="article" />
<meta property="og:title" content="Questo apparirà come titolo - This is title" />
<meta property="og:description" content="This is description - Questa invece sarà la descrizione del link corrispondente a questa pagina." />
<meta property="og:url" content="https://url.sito/path/" />
<meta property="og:site_name" content="URL Sito" />
<meta property="article:author" content="https://www.facebook.com/pippo.pappo" />
<meta property="og:image" content="http://static01.nyt.com/images/2015/02/19/arts/international/19iht-btnumbers19A/the_image_you_like.jpg" />
@salvatorecapolupo
salvatorecapolupo / track-click-analytics.js
Created September 1, 2019 10:58
Simple way to add utm_medium / utm_source to any inner link inside your website, as described well here: https://support.google.com/analytics/answer/1033867?hl=en
jQuery(document).ready(function( $ ){
//track single link
var original_link1 = jQuery("a#single").attr('href');
jQuery(elem).attr('href', original_link + '?utm_source=A&utm_medium=B&utm_campaign=C');
//track multi-links
var link_group_identifier = 'a.group';
jQuery( link_group_identifier ).each(function(i, elem) {
var original_link = jQuery(elem).attr('href');
@salvatorecapolupo
salvatorecapolupo / Useful RESTful API for WordPress
Created September 2, 2019 12:19
Enumerate users, plugins, and so on
* Enumerate Users
wp-json/wp/v2/users
- Example
curl https://example.com/wp-json/wp/v2/users
@salvatorecapolupo
salvatorecapolupo / siti-guest-post
Last active March 5, 2021 10:44
Siti che ammettono guest post (aggiornata al 15 settembre 2019)
- fai.informazione.it (basta registrarsi gratuitamente)
- recesiti.wordpress.com (info s.capolupo@gmail.com)
- leultime.info (info s.capolupo@gmail.com)
- medium.com (basta registrarsi)
- linkedin.com (c'è un blog pubblico che si può attivare)
- comunicati.net (basta registrarsi)
- contenutigratis.altervista.org (basta registrarsi, soggetto a moderazione)
- comunicati-stampa.net (basta registrarsi, soggetto a moderazione)
@salvatorecapolupo
salvatorecapolupo / FAQPage-rich-snippets.php
Created September 21, 2019 07:13
Dynamic WordPress FAQPage Rich Snippets - use this in a plugin or functions.php
<?PHP
function add_rich_snippets_content( $content ) {
global $post;
$post_ID = $post->ID;
$page_title = get_the_title ( $post_ID );
$page_object = get_post( $post_ID );
$page_excerpt = wp_strip_all_tags ( $page_object->post_content );
$page_excerpt = preg_split ("/\s/", $page_excerpt);
@salvatorecapolupo
salvatorecapolupo / referrer-basis-redirect
Created September 21, 2019 10:09
This is useful for some backlinks "recovery".
<?PHP
function smart_seo_redirect(){
if ( isset($_SERVER['HTTP_REFERER']) ){
$referrer = $_SERVER['HTTP_REFERER'];
$parse = parse_url($referrer);
$referrer = $parse['host'];
$matches = [];
$matches[]= preg_match('/cool_referral_name/', $referrer, $matches);