Skip to content

Instantly share code, notes, and snippets.

View pagetronic's full-sized avatar
👮‍♂️
Restructuration !

Laurent PAGE pagetronic

👮‍♂️
Restructuration !
View GitHub Profile
@pagetronic
pagetronic / WikiCommonDateParser.java
Last active October 4, 2024 10:22
Parse complex wikiSyntax date
package live.page.utils;
import com.drew.imaging.ImageMetadataReader;
import com.drew.metadata.Metadata;
import com.drew.metadata.exif.ExifSubIFDDirectory;
import live.page.hubd.blobs.Blob;
import live.page.hubd.system.json.Json;
import java.text.SimpleDateFormat;
import java.util.Date;
package org.agroneo.web.oauth;
import jakarta.servlet.annotation.WebServlet;
import live.page.hubd.system.Settings;
import live.page.hubd.system.servlet.wrapper.WebServletRequest;
import live.page.hubd.system.servlet.wrapper.WebServletResponse;
import live.page.hubd.system.sessions.OAuthServlet;
import live.page.hubd.system.sessions.Users;
import live.page.hubd.system.sessions.oauth.OauthDatas;
import live.page.hubd.system.sessions.oauth.OauthUtils;
@pagetronic
pagetronic / WikiLocation.java
Last active August 29, 2024 18:09
Commons wikimedia to Json
package live.page.wiki;
import live.page.hubd.system.json.Json;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class WikiLocation {
public static List<Double> findLocation(Json data) {
import 'dart:async';
class Deferrer {
final int milliseconds;
Future? _next;
Deferrer(this.milliseconds);
void defer(void Function() toDo) {
Future? next_;
@pagetronic
pagetronic / aync.dart
Created November 1, 2023 10:54
FutureOrBuilder
import 'dart:async';
import 'package:flutter/widgets.dart';
class FutureOrBuilder<T> extends StatelessWidget {
final FutureOr<T?> future;
final Widget Function(BuildContext context, AsyncSnapshot<T?> snapshot) builder;
const FutureOrBuilder({super.key, required this.builder, required this.future});
@pagetronic
pagetronic / color_picker.dart
Last active October 24, 2023 11:04
Simple color picker for Flutter
import 'dart:math';
import 'dart:typed_data';
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
class ColorPicker extends StatefulWidget {
final ValueNotifier<Color?> color;
const ColorPicker({super.key, required this.color});
@pagetronic
pagetronic / events.dart
Last active October 6, 2023 13:09
Flutter Big SQLite && Big ListView with low memory consumption
import 'package:sqflite_common_ffi/sqflite_ffi.dart';
import '../../map/utils/geojson.dart';
import 'objs.dart';
class Event extends DbObject {
String? asset;
int? surface;
int? regna;
int? event;
/*
* Copyright 2019 Laurent PAGE, Apache Licence 2.0
*/
package com.agroneo.grow.system.utils;
import android.text.Html;
import android.text.Spanned;
import androidx.annotation.NonNull;
/*
* Public Domain @ CPMGN
* Centre de Production Multimédia de la Gendarmerie Nationale
*/
package com.agroneo.grow.system.utils;
import android.os.Handler;
import android.os.Looper;
import java.util.concurrent.ExecutorService;
@pagetronic
pagetronic / ShortsModels.java
Created January 31, 2022 16:08
Intent modeler
package fr.gendarmerie.docpro.settings.shortcuts;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ShortcutInfo;
import android.graphics.drawable.Icon;
import androidx.annotation.Nullable;
import org.apache.commons.lang3.StringUtils;