Skip to content

Instantly share code, notes, and snippets.

View djibe's full-sized avatar

JB djibe

View GitHub Profile
@djibe
djibe / select2-standalone-material.css
Last active July 11, 2020 14:14
Material theme for Select2 (standalone) v0.1.0
/* Select2 jQuery plugin standalone material design theme by djibe
*
*/
.select2-container {
display: block;
margin: 0;
min-width: 200px;
position: relative; }
.select2-container *:focus {
outline: 0; }
@djibe
djibe / hugo-shortcode-table.html
Last active January 26, 2023 15:03
Hugo static site ultimate table shortcode
{{ $htmlTable := .Inner | markdownify }}
{{ $old := "<table>" }}
{{ $new := "" }}
{{ $title := .Get "title" }}
{{ $extraClass := .Get "class" }}
{{ $id := "" }}
{{ with .Get "id" }}
{{ $id = . }}
{{ else }}
{{ $id = delimit (shuffle (seq 1 9)) "" }}
@djibe
djibe / fidelityfx-photo-upscale
Created November 25, 2021 21:36
FidelityFX example command
`FidelityFX_CLI.exe -Scale 4x 4x -Mode CAS -Sharpness 0.3 -FP16 input.jpg output.jpg`
@djibe
djibe / windows10-command-tweaks.md
Last active June 5, 2024 02:23
Windows 10 Command Tweaks

Windows 10 and 11 optimizations

Minimal script

:: Check for updates
%windir%\system32\usoclient ScanInstallWait
:: Set Powermode
powercfg -duplicatescheme e9a42b02-d5df-448d-aa00-03f14749eb61
@djibe
djibe / Webmaster tools site migration
Last active January 21, 2022 09:09
Informations from search engines for moving/transfering a site to a new URL
## Google
## Microsoft Bing
<https://blogs.bing.com/webmaster/december-2020/Website-Migration-with-Bing>
Site Move tool Has vanished, GuavaRank promotes:
- Complete the change of address steps in Google Search Console
- Add and verify the new domain in Bing
@djibe
djibe / css-memo.md
Last active January 28, 2024 21:01
State of CSS 2023 Memo

State of CSS 2023 Memo

Reset CSS

/***
    The new CSS reset - version 1.11 (last updated 20.9.2023)
    GitHub page: https://github.com/elad2412/the-new-css-reset
***/
@djibe
djibe / urql-client-demo.md
Last active February 7, 2023 19:05
Simplest URQL client demo
// Requires Node 18+, plays witk PokeApi GraphQL beta

import { createClient } from '@urql/core';

const client = createClient({
  url: 'https://beta.pokeapi.co/graphql/v1beta'
});

const query = `
@djibe
djibe / nodejs-list-files-and-rename.md
Created April 11, 2023 07:24
NodeJS: list files in subfolders with special extension and export a list of renamed files
const fs = require('fs');
const path = require('path');

const directoryPath = path.join(__dirname, './content/recommandations');
const exportPath = path.join(__dirname, './data/application');

// Create the folder directory if it doesn't exist
if (!fs.existsSync(exportPath)) {
 fs.mkdirSync(exportPath);
@djibe
djibe / wsl-windows11.md
Last active September 1, 2023 08:03
Install WSL2 in Windows 11

WSL 2 (Windows Subsystem for Linux v2) for Windows 11 installation

Install WSL components

Check Windows Update is active.

Open Start menu: search for exploit > click on "Exploit protection" result.

Go to Program settings tab. Search for C:\WINDOWS\System32\vmcompute.exe and vmwp.exe.

@djibe
djibe / hugo-tips.md
Last active July 1, 2024 17:03
Hugo static site good tips

Good tips for Hugo Static site generator

Conditionals

Range in a range of set

List 9 files published after the last 6 within the recommandations section.

{{ range first 9 ( after 6 (where site.RegularPages.ByPublishDate.Reverse "Section" "recommandations" )) }}