Skip to content

Instantly share code, notes, and snippets.

View adriengibrat's full-sized avatar
:octocat:
open sourcing when not too busy

Adrien Gibrat adriengibrat

:octocat:
open sourcing when not too busy
View GitHub Profile
@adriengibrat
adriengibrat / Object.prototype.watch.js
Last active April 23, 2020 19:24
Object.prototype.watch "polyfill"
/**
* Object.prototype.watch polyfill
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/watch
*
* Known limitations:
* - `delete object[property]` will remove the watchpoint
*
* Based on Eli Grey gist https://gist.github.com/eligrey/384583
* Impovements based on Xose Lluis gist https://gist.github.com/XoseLluis/4750176
* This version is optimized for minification
#[...]
# Default language to English
export LANG=en_US.UTF-8
export LANGUAGE=en_US
export LC_ALL=en_US.UTF-8
#export LC_MESSAGES=en_US
#export LC_MESSAGES=C
# GIT PS1 FTW
@adriengibrat
adriengibrat / bower.json
Last active March 13, 2022 00:39
Parse ISO 8601 duration as function that sums duration to a given date
{
"name": "parseDuration",
"version": "0.0.1",
"main": "./parseDuration.es5.js"
}
@import url('https://fonts.googleapis.com/css?family=Roboto');
button {
cursor: pointer;
}
https://github.com/CaoKha/tenisu-app
+ playwright (getByRole)
+ vite / vitest: template ?
+ vercel <3
+ minimal css global (:root / variables / fontfaces)
? tenis-card: onClick -> Link router, className ?, css-in-js vs css variables DX (autocomplete?)
? searchbar.spec: filterPlayer = pure -> test without duplication, use import, refactor to use store
? store: context <3, API low level, why not move app logic to context?
? detailPage: DRY components, Architecture refactor: embed API call or data retrieval (refresh error message is a limitation)
@adriengibrat
adriengibrat / l.php
Last active January 22, 2024 14:45
Extreme minification of shortest possible PSR-0 compliant autoloader, 5 lines !
<?php
//set_include_path(get_include_path() . PATH_SEPARATOR . __DIR__); // optional
spl_autoload_register(function ($class) {
$file = preg_replace('#\\\|_(?!.+\\\)#','/', $class) . '.php';
if (stream_resolve_include_path($file))
require $file;
});