Skip to content

Instantly share code, notes, and snippets.

View vmingam's full-sized avatar
💻
Building stuff

Vincent Mingam vmingam

💻
Building stuff
  • Pyrénées-Atlantiques, Nouvelle-Aquitaine, France, Earth
  • X @bixpix
View GitHub Profile
@LewisJEllis
LewisJEllis / getRelativeTimeString.ts
Last active November 8, 2024 00:35
Simplified getRelativeTimeString
// from https://twitter.com/Steve8708/status/1504131981444980739
// simplified to a function body of 8 tidy lines
// no loop needed, no 2d array of 3-tuples needed
// just 2 arrays, a findIndex call, and some indexing :)
export function getRelativeTimeString(
date: Date | number,
lang = "en"
): string {
const timeMs = typeof date === "number" ? date : date.getTime();
@fmtarif
fmtarif / .htaccess
Created June 11, 2014 14:24
#htaccess List of all mod_rewrite variables
###### List of Mod_Rewrite Variables: http://www.askapache.com/htaccess/mod_rewrite-variables-cheatsheet.html
###HTTP header variables:
#HTTP_USER_AGENT, HTTP_REFERER,
#HTTP_COOKIE, HTTP_FORWARDED, HTTP_HOST, HTTP_PROXY_CONNECTION, HTTP_KEEP_ALIVE
#HTTP_ACCEPT, HTTP_ACCEPT_CHARSET, HTTP_ACCEPT_ENCODING, HTTP_ACCEPT_LANGUAGE
#HTTP_CACHE_CONTROL, HTTP_CONNECTION
###Connection & request variables:
# REMOTE_ADDR, REMOTE_HOST, REMOTE_PORT, REMOTE_USER, REMOTE_IDENT