Skip to content

Instantly share code, notes, and snippets.

View luigifab's full-sized avatar
🏝️
I'm out there

luigifab

🏝️
I'm out there
View GitHub Profile
@luigifab
luigifab / PhpUserAgent.rb
Last active December 9, 2023 08:51
v1.8.0-fork2 (tested with ruby 2.2.10 / 2.3.8 / 2.4.10 / 2.6.6 / 2.7.3 / 3.1.2)
# encoding: utf-8
#
# Copyright 2013-2023 | Jesse G. Donat <donatj~gmail~com>
# https://github.com/donatj/PhpUserAgent
#
# Copyright 2019-2023 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
# https://gist.github.com/luigifab/19a68d9aa98fa80f2961809d7cec59c0 (1.8.0-fork2)
#
# Parses a user agent string into its important parts
# Licensed under the MIT License
@luigifab
luigifab / PhpUserAgent.php
Last active December 9, 2023 08:50
v1.8.0-fork2 (tested with php 7.2 / 7.3 / 7.4 / 8.0 / 8.1 / 8.2 / 8.3)
<?php
/**
* Copyright 2013-2023 | Jesse G. Donat <donatj~gmail~com>
* https://github.com/donatj/PhpUserAgent
*
* Copyright 2019-2023 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* https://gist.github.com/luigifab/4cb373e75f3cd2f342ca6bc25504b149 (1.8.0-fork2)
*
* Parses a user agent string into its important parts
* Licensed under the MIT License
@luigifab
luigifab / appearance__focus-visible.gtk3.patch
Last active February 11, 2024 10:11
gtk3-classic (GTK 3.24) [gtk-3.24.40-deb.sh] & gtk4-classic (GTK 4.12) [gtk-4.12.5-deb.sh] / for Debian Testing
# GtkWindow3: restore focus on application start
# https://github.com/GNOME/gtk/blob/3.24.37/gtk/gtkwindow.c
Index: b/gtk/gtkwindow.c
===================================================================
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -6357,7 +6357,9 @@ gtk_window_map
/* inherit from transient parent, so that a dialog that is
* opened via keynav shows focus initially
*/
@luigifab
luigifab / index.php
Last active June 25, 2022 09:07
OpenStreetMap and OpenTopoMap local cache
<?php
// configuration : https://www.visugpx.com/forum/read_13532.html
error_reporting(E_ALL);
ini_set('display_errors', 1);
ini_set('default_socket_timeout', 20);
//echo '<pre>'; print_r($_SERVER); exit;
$host = getenv('HTTP_HOST');
$tile = getenv('REQUEST_URI');
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
@luigifab
luigifab / __init__.py
Last active January 1, 2024 11:44
time series inverted on radex1212
#!/usr/bin/python3
# -*- coding: utf8 -*-
# Created L/19/10/2020
# Updated L/01/01/2024
#
# Copyright 2020-2024 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
# https://github.com/luigifab/python-radexreader
#
# This program is free software, you can redistribute it or modify
# it under the terms of the GNU General Public License (GPL) as published
-- DEBUG FOR ONE ORDER AND ONE SHIPMENT
-- RUN THIS BEFORE AND AFTER AND COMPARE
SELECT increment_id, weight
FROM sales_flat_order;
SELECT sfoi.product_type, sfoi.item_id, sfoi.parent_item_id, sfoi.product_id, CAST(sfoi.qty_ordered AS FLOAT) AS qty,
CAST(sfoi.row_weight AS FLOAT) AS order_row_weight, CAST(sfoi.weight AS FLOAT) AS order_weight,
sfsi.entity_id AS ship_item_id, CAST(sfsi.weight AS FLOAT) AS shipment_weight,
CAST(cped.value AS FLOAT) AS orig_weight