Skip to content

Instantly share code, notes, and snippets.

View sfnprg's full-sized avatar

Stefano sfnprg

View GitHub Profile
@sfnprg
sfnprg / yww-display-wp-scripts-in-use.php
Last active September 21, 2024 21:06
[Wordpress] display scripts loaded in `wp_head` and `wp_footer`
<?php
/**
* A simple Wordpress function to add to your `functions.php` file in your theme to display
* stack of loaded scripts in `wp_head` and `wp_footer`.
* Can be used to control loading, get list/name to add defer or async
* Originally inspired by https://www.myhostingfacts.com/optimize-css-delivery-inline-and-defer-javascript-wordpress/
* @link https://www.yesweweb.com
*
* Author: Yes We Web
* Author URI: https://www.yesweweb.com
@sfnprg
sfnprg / gravityforms-full-countries-name-code.txt
Last active April 5, 2019 15:43
Gravity Forms drop down values: country list with codes / Italian provinces
Afghanistan|AF
Åland Islands|AX
Albania|AL
Algeria|DZ
American Samoa|AS
Andorra|AD
Angola|AO
Anguilla|AI
Antarctica|AQ
Antigua and Barbuda|AG
@sfnprg
sfnprg / bulk-mysqldump-gzip.txt
Created November 10, 2019 12:40
mysqldump all available databases
mysql -s -r --user <USER> --password=<PASSWORD> -e 'show databases' | while read db; do mysqldump --user <USER> --password=<PASSWORD> $db | gzip > <SERVER_PATH>/export/${db}_$(date +%Y%m%d-%H%M%S).sql.gz; done
@sfnprg
sfnprg / pagesjaunes.fr_multi-page.js
Created May 10, 2020 12:50
artoo.js - scraping codes
var scraper = {
iterator: 'article.bi-bloc.blocs.bi-pro',
data: {
name: {sel: 'a.denomination-links', attr: 'title'},
profile_url: {sel: 'a.denomination-links', attr: 'href', method: function($) {
var url = $(this).attr('href').replace("#", "");
if (url) {
url = "https://www.pagesjaunes.fr" + url;
}
return url;
@sfnprg
sfnprg / adblock-custom-list.txt
Last active July 3, 2025 07:26
Custom blocklist of DNS including annoying ads, autoplayers, malware, scam, ...
[AdBlock Plus]
! Title: sfnprg's custom DNS blocklist
!
||player.anyclip.com^
||2mdn.net^
||cdn.taboola.com^
||media-video.tcccdn.com
||cdn.vlyby.com^
||zoomin.tv^
||blackbird.zoomin.tv^