Skip to content

Instantly share code, notes, and snippets.

View emiliodallatorre's full-sized avatar

Emilio Dalla Torre emiliodallatorre

View GitHub Profile
CREATE DATABASE wordpress;
CREATE USER wordpress@localhost IDENTIFIED BY '<your-password>';
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER ON wordpress.* TO wordpress@localhost;
FLUSH PRIVILEGES;
quit
# Create VM istance and log into it
multipass launch --name jetop-wordpress
multipass shell jetop-wordpress
# Update packages
sudo apt update && sudo apt upgrade -y
# Install nginx and net-tools
sudo apt install nginx net-tools
import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:geoflutterfire2/geoflutterfire2.dart';
class LocationHelper {
static Map<String, dynamic> geoFirePointToJson(final GeoFirePoint? geoFirePoint) {
return geoFirePoint?.data;
}
static GeoFirePoint? geoFirePointFromJson(final Map<String, dynamic>? json) {
if (json == null) {
@emiliodallatorre
emiliodallatorre / key_properties_extractor.py
Created August 22, 2023 09:03
Simple script to extract key.properties from a list of Flutter project directories
from os import walk
from os.path import exists
directories: list = walk(".")
key_properties_files: dict = {}
for directory in directories:
# Check if it is a flutter project
if "pubspec.yaml" in directory[2]:
# Check if key.properties exists
#!/bin/bash
rm -rf wp-includes
rm -rf wp-admin
wp core download --skip-content --force --allow-root
wp plugin install $(wp plugin list --field=name --allow-root) --force --allow-root
wp theme install $(wp theme list --field=name --allow-root) --force --allow-root
find wp-content/uploads -name "*.php" -delete
@emiliodallatorre
emiliodallatorre / httpd.conf
Last active November 10, 2022 21:07
Configurazione per Climax di HTTPD
# Server per il debug di Climax
LoadModule php_module /usr/local/lib/httpd/modules/libphp.so
<VirtualHost *:8080>
# TODO: Sostituire con il percorso alla cartella del progetto nel proprio computer
DocumentRoot /Users/emiliodallatorre/Documents/GitHub/climax-webapp-php
ErrorLog /Users/emiliodallatorre/Documents/GitHub/climax-webapp-php/error.log
CustomLog /Users/emiliodallatorre/Documents/GitHub/climax-webapp-php/access.log combined
Options Indexes FollowSymLinks Multiviews Indexes
@emiliodallatorre
emiliodallatorre / find_route_without_context.dart
Created August 25, 2022 19:33
Find current route without context
// https://stackoverflow.com/questions/46483949/how-to-get-current-route-path-in-flutter
String? currentPath;
navigatorKey.currentState?.popUntil((Route<dynamic> route) {
currentPath = route.settings.name;
return true;
});
@emiliodallatorre
emiliodallatorre / default.conf
Last active June 7, 2022 19:00
Empty Nginx web server configuration
# server {
# listen 80;
# server_name yourhostname.it www.yourhostname.it;
# return 301 https://yourhostname.it$request_uri;
# }
server {
# listen 443 ssl; # managed by Certbot
# ssl_certificate /etc/letsencrypt/live/yourhostname.it/fullchain.pem; # managed by Certbot
# ssl_certificate_key /etc/letsencrypt/live/yourhostname.it/privkey.pem; # managed by Certbot
@emiliodallatorre
emiliodallatorre / lab_chrono.py
Created September 28, 2021 19:34
Un semplice script per un cronometro da laboratorio che tiene traccia delle misurazioni fatte.
from datetime import datetime
measures: list = []
while True:
print()
key: str = input(
"Premi un tasto qualsiasi per avviare il conteggio, \"r\" per fermare le misurazioni ")
if key == "r":
break
@emiliodallatorre
emiliodallatorre / index.php
Created August 13, 2021 17:24
Un file per testare la funzionalità di un'installazione di PHP + Nginx.
<?php
phpinfo();