Skip to content

Instantly share code, notes, and snippets.

View viki53's full-sized avatar
🏠
Working from home

Corentin Hatte viki53

🏠
Working from home
View GitHub Profile
@viki53
viki53 / firefox-stylus.user.css
Last active March 13, 2023 16:50
HuffingtonPost cookies
/* ==UserStyle==
@name Huffington-Post-cookies
@namespace huffingtonpost
@match https://www.huffingtonpost.fr/*
@description Cache la bannière de cookies (et réactive le scroll) sur le site huffingtonpost.fr
@version 1.0.0
@author Corentin Hatte (https://www.github.com/viki53)
@homepageURL https://gist.github.com/viki53/1411e0b965e67c3ba0f140fe1fdeece9
@updateURL https://gist.github.com/viki53/1411e0b965e67c3ba0f140fe1fdeece9/raw/firefox-stylus.user.css
@preprocessor default
@viki53
viki53 / firefox-stylus.user.css
Last active June 28, 2022 10:58
Credit-Mutuel-cookies
/* ==UserStyle==
@name Credit-Mutuel-cookies
@namespace creditmutuel
@match https://www.creditmutuel.fr/*
@description Cache la bannière de cookies (et réactive le scroll) sur le site creditmutuel.fr
@version 1.0.0
@author Corentin Hatte (https://www.github.com/viki53)
@homepageURL https://gist.github.com/viki53/99d8bdf95626bc241ee99308041b7dd8
@updateURL https://gist.github.com/viki53/99d8bdf95626bc241ee99308041b7dd8/raw/firefox-stylus.user.css
@preprocessor default
@viki53
viki53 / firefox-stylus.user.css
Last active September 6, 2022 08:06
LinkedIn distraction-free
/* ==UserStyle==
@name linkedin-no-distraction
@namespace linkedin.com
@description Remove most distractions on LinkedIn
@version 1.0.3
@author Corentin Hatte (https://www.github.com/viki53)
@homepageURL https://gist.github.com/viki53/5d0f45e5f7ff2f77a772cb1f5694f2dc
@updateURL https://gist.github.com/viki53/5d0f45e5f7ff2f77a772cb1f5694f2dc/raw/firefox-stylus.user.css
@preprocessor default
==/UserStyle== */
@viki53
viki53 / firefox-stylus.user.css
Last active January 3, 2022 13:41
TweetDeck centered
/* ==UserStyle==
@name tweetdeck-centered
@namespace tweetdeck.twitter.com
@description Center TweetDeck's columns on large screens
@version 1.0.3
@author Corentin Hatte (https://www.github.com/viki53)
@homepageURL https://gist.github.com/viki53/57f3a84bb629487f0568a741957d475d
@updateURL https://gist.githubusercontent.com/viki53/57f3a84bb629487f0568a741957d475d/raw/firefox-stylus.user.css
@preprocessor default
==/UserStyle== */
@viki53
viki53 / Arc Boost
Last active March 13, 2024 10:03
ZdS largeur fixe
https://arc.net/boost/86FB313B-210C-49D5-8D51-A0CD7ACEFA31
@viki53
viki53 / extract_toc.php
Created April 21, 2020 12:43
PHP Table Of Content extracting
<?php
require_once('./url_title.php');
require_once('./xss_clean.php');
if (!function_exists('extract_toc')) {
function extract_toc(DOMDocument $dom, int $max_level = 6) {
$xpath = new DOMXPath($dom);
$xpath->registerNamespace('html', 'http://www.w3.org/1999/xhtml');
$max_level = min(max($max_level, 1), 6); // Les titres en HTML vont de h1 à h6 maximum
@viki53
viki53 / time-to-seconds.js
Created March 10, 2020 09:05
input time to seconds
time = input.value; // Ex: '02:30:25'
seconds = time.split(':').reverse().reduce((t, s, i) => { return t + (Math.pow(60, i) * parseInt(s)) }, 0);
@viki53
viki53 / api.service.ts
Last active November 17, 2017 15:09
Using Cognito authentication with AWS Cognito in API Gateway
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { AuthGuardService } from './auth-guard.service';
import { AWS_APIGW_ID, AWS_REGION } from '../conf/aws.const';
export const API_ROOT = `https://${AWS_APIGW_ID}.execute-api.${AWS_REGION}.amazonaws.com/prd`;
@Injectable()
export class ApiService {
<?php
$lang = '';
if(!empty($_SERVER['PATH_INFO']) && strlen($_SERVER['PATH_INFO']) >= 3){
$path_info_lang = substr($_SERVER['PATH_INFO'], 1);
if(preg_match('`^([a-z-]+)$`i', $path_info_lang) && is_file($path_info_lang.'.html')){
$lang = $path_info_lang;
}
}
if(empty($lang) && !empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
preg_match_all("/([[:alpha:]]{1,8})(-([[:alpha:]|-]{1,8}))?"."(\s*;\s*q\s*=\s*(1\.0{0,3}|0\.\d{0,3}))?\s*(,|$)/i", $_SERVER['HTTP_ACCEPT_LANGUAGE'], $accepted_languages, PREG_SET_ORDER);
@viki53
viki53 / dabblet.css
Created May 27, 2013 12:08
Shake ton <body>
/* Shake ton <body> */
html{
height: 100%;
background-color: #69c3fb;
background-size: contain;
background-image: radial-gradient(circle closest-side, #ccebfe 0%, #69c3fb 100%);
background-repeat: no-repeat;
}