Skip to content

Instantly share code, notes, and snippets.

@tbl0605
tbl0605 / Demo.vue
Last active July 26, 2023 09:43
Create VeeValidate rules that use asynchronous function calls for input validation (requires p-queue, Vue.js 2.x and VeeValidate 3.x)
<template>
<ValidationObserver v-slot="{ validate }">
<form class="needs-validation" novalidate @submit.stop.prevent="">
<div class="form-row align-items-start">
<div class="form-group col-8">
<ValidationProvider
:rules="asyncRule"
name="Album number"
:mode="blurMode"
v-slot="validatorData"
@tbl0605
tbl0605 / settings
Last active June 14, 2023 23:04
FS-UAE Launcher options for best gaming experience
# https://eab.abime.net/showthread.php?t = 97979&page=2
# https://www.amigans.net/modules/newbb/viewtopic.php?forum = 8&topic_id=6918
# cpu will here function as a global config default and may cause
unexpected problems. It is recommended to only use this as a per-config option.
cpu = 68020
# jit_compiler will here function as a global config default and may cause
unexpected problems. It is recommended to only use this as a per-config option.
@tbl0605
tbl0605 / download.md
Last active April 3, 2023 08:57
How to support download with resume in PHP (the right way)

How to support download with resume in PHP (the right way)

Since I found a lot of buggy or incomplete PHP implementations, I wrote my own implementation which should work in most situations. Works with PHP >= 7.1 and allows to download files > 2 GB, even on a 32 bits OS or PHP version!

  1. copy download.php in a folder served by your Apache
  2. optionally modify the value of \Downloader\Download::LOCAL_CHARSET to match the charset used by your PHP installation
  3. store a big file that will be accessible for download, in this example it will be C:\temp\kubuntu-22.04-desktop-amd64.iso
  4. open your favorite browser and type:
localhost/path_to_your_php_folder/download.php?path=C:/temp/kubuntu-22.04-desktop-amd64.iso
@tbl0605
tbl0605 / 2774_example2.html
Last active March 20, 2020 11:14
Bug using vue-router, Edge and a file hosted on a local windows filesystem WITH WORKAROUND (see vue-router issue 2774)
<!DOCTYPE html>
<html>
<head>
<title>Additional comment for Issue 2774 (with workaround)</title>
<meta charset="utf-8" />
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-router@3.1.6/dist/vue-router.min.js"></script>
</head>
<body>
<h1>
@tbl0605
tbl0605 / 2774_example.html
Last active March 20, 2020 10:59
Bug using vue-router, Edge and a file hosted on a local windows filesystem (see vue-router issue 2774)
<!DOCTYPE html>
<html>
<head>
<title>Additional comment for Issue 2774</title>
<meta charset="utf-8" />
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue-router@3.1.6/dist/vue-router.min.js"></script>
</head>
<body>
<h1>
@tbl0605
tbl0605 / index.html
Created September 1, 2019 15:22
Tesla avec Bootstrap
<!-- ENTETE -->
<header>
<nav>
<div class="container">
<img src="https://believemy.com/uploads/2f3811b9174e35a2d77902ffd36a9a37_4dfb82dd429edb6a11a81ff74e9abfc4.png" style="height: 30px"/>
</div>
</nav>
</header>
@tbl0605
tbl0605 / .htaccess
Last active February 1, 2023 13:12
How to find&store base URL in .htaccess files (as environment variable HTTP_BASE)
# Necessary to prevent problems when using a controller named "index" and having a root index.php
# more here: http://httpd.apache.org/docs/2.2/content-negotiation.html
Options -MultiViews
# Prevent people from looking directly into folders
Options -Indexes
# Activates URL rewriting (like myproject.com/controller/action/1/2/3)
Options +FollowSymlinks
RewriteEngine On
@tbl0605
tbl0605 / CsvIterator.php
Last active April 3, 2023 08:34
CSV managing class: Store and retrieve data from CSV files using an Iterator implementation
<?php
namespace tbl0605\Spreadsheet;
/**
* CSV managing class: Store and retrieve data from CSV files<br>
* => can import a csv file and iterate over the items<br>
* => allows to specify the separator and the enclosure
*
* Requires at least PHP 5.3
*