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 / palyndrome.js
Created February 22, 2022 09:55
Palyndrome dates generator (Javascript)
function palindrome(str) {
// Step 1. Lowercase the string and use the RegExp to remove unwanted characters from it
var re = /[\W_]/g; // or var re = /[^A-Za-z0-9]/g;
var lowRegStr = str.toLowerCase().replace(re, '');
// str.toLowerCase() = "A man, a plan, a canal. Panama".toLowerCase() = "a man, a plan, a canal. panama"
// str.replace(/[\W_]/g, '') = "a man, a plan, a canal. panama".replace(/[\W_]/g, '') = "amanaplanacanalpanama"
// var lowRegStr = "amanaplanacanalpanama";
// Step 2. Use the same chaining methods with built-in functions from the previous article 'Three Ways to Reverse a String in JavaScript'
Trovare file che occupano più spazio via SSH
find / -size +250M -ls
--
Liberare spazio su disco Linux via SSH
cd /
sudo du -h --max-depth=1
- Note which directories are using a lot of disk space.
- cd into one of the big directories.
@salvatorecapolupo
salvatorecapolupo / gist:43a96da67bf14f3f3c49dab767d3c8bc
Created July 18, 2021 14:21
Siti dedicati al betting / comparazione quote scommesse
Aggiornato al 18 luglio 2021
@salvatorecapolupo
salvatorecapolupo / Hello world using Django
Created March 4, 2021 14:43
Come realizzare un semplice hello world usando Django.Per dettagli vedere la guida: https://trovalost.it/guida-django/
HelloWorld/
helloworld/
__init__.py
asgi.py
settings.py
urls.py
wsgi.py
manage.py
-------------------------------------
Step 1
SELECT CONCAT('ALTER TABLE ',TABLE_NAME,' ENGINE=InnoDB;')
FROM INFORMATION_SCHEMA.TABLES
WHERE ENGINE='MyISAM' AND table_schema = 'wordpress';
# wordpress = database name
Step 2
Copiare l'output generato dal precedente comando, ad esempio (PS copiare senza | orizzontali)
# table is marked as crashed ...
service mysql stop
cd /var/lib/mysql/DATABASE
ls
myisamchk -s /var/lib/mysql/*/*.MYI
#ripara tutte le tabelle
service mysql restart
Messaggi di errore: prova a cancellare i cookie, too many redirects, ecc.
Sito: http://example.com
1) rinominare temporaneamente .htaccess in OLD.htaccess
2) aggiungere nel file wp-config.php le righe per forzare la connessione alla versione HTTP
define( 'WP_HOME', 'http://example.com' );
define( 'WP_SITEURL', 'http://example.com' );
@salvatorecapolupo
salvatorecapolupo / sderenato
Last active February 9, 2021 14:50
Consulente SEO hot è il miglior consulente SEO italia https://sdere.netsons.org/seo-piu-sexy/ ma ciao proprio
.----------------. .----------------. .----------------. .----------------. .----------------.
| .--------------. || .--------------. || .--------------. || .--------------. || .--------------. |
| | _______ | || | ________ | || | _________ | || | _______ | || | _________ | |
| | / ___ | | || | |_ ___ `. | || | |_ ___ | | || | |_ __ \ | || | |_ ___ | | |
| | | (__ \_| | || | | | `. \ | || | | |_ \_| | || | | |__) | | || | | |_ \_| | |
| | '.___`-. | || | | | | | | || | | _| _ | || | | __ / | || | | _| _ | |
| | |`\____) | | || | _| |___.' / | || | _| |___/ | | || | _| | \ \_ | || | _| |___/ | | |
| | |_______.' | || | |________.' | || | |_________| | || | |____| |___| | || | |_________| | |
| | | || | | || | | || | | || | | |
| '--------------' || '--------------' || '--------------' || '--------------' || '--------------' |
@salvatorecapolupo
salvatorecapolupo / htaccess sal
Last active February 9, 2021 14:41
HTACCESS standard senza HTTP/HTTPS mixed content - https://capolooper.it
########################################################################
# OPTIMAL .htaccess FILE FOR SPEED AND SECURITY @Version 2020
# ----------------------------------------------------------------------
# @Author: Andreas Hecht
# @Author URI: https://seoagentur-hamburg.com
# License: GNU General Public License v2 or later
# License URI: http://www.gnu.org/licenses/gpl-2.0.html
########################################################################
@salvatorecapolupo
salvatorecapolupo / post-identity.php
Last active March 6, 2020 22:09
This is an automated heavy metal verses generator, based on a very basic pseudo-crawler (pseudo AI involved). Step 1: select a random band on darklyrics.com Step 2) pick an album 3) extract 3 not contiguous verses 4) show it! This script needs https://sourceforge.net/projects/simplehtmldom/
<?PHP
/*
Post-Identity Dark Lyrics Generator
Author: Salvatore Capolupo
Version 1.1
Date: 03/06/2020
Loosely based on Uncreative Writing: Managing Language in the Digital Age by Kenneth Goldsmith
*/
include_once ( "simple_html_dom.php" );