291 private links
More git tips and tricks.
Aliases are underused
mkdir -p instead of mkdir
ln -sfn source target instead of ln -s source target
rm -f example.txt instead of rm example.txt
Modifying a file
if ! grep -qF "/mnt/dev" /etc/fstab; then
echo "/dev/sda1 /mnt/dev ext4 defaults 0 0" | sudo tee -a /etc/fstab
fi
Check if variable, file or dir exists
formatting a device
mounting a device
Ne jamais parler en garde à vue, car on risque de dire de la merde, même si on est innocent.
Voici pourquoi dans cet article.
A new $HOME folder structure to improve the workflow:
| name | structure | created by | status |
|---|---|---|---|
| tmp | (chaotic) | everyone | temporary |
| work | project-name/ |
me | active |
| permanent | project-name/ |
me | permanent |
| archive | year/type/project-name/ |
me | done or inactive |
| library | type/(subtype/) |
others | reference |
edit 2022-05-19: the more I think about it, the more I find it to be a good idea.
On google or DuckDuckGo syntax:
- "Exact match" → for an exact string
- SITE:url → search in a specified site
- AFTER:1999 or BEFORE:2020 → before or after a specified date
- 2020..2020 → search in a range
- (A | B) → search results A or B
-
- → search for all results
- FILETYPE:PDF → search for a specified filetype
- RELATED:url → search related result of this URL
9: CACHE:url → see the website that the search engine has in cache
In the configuration: "workbench.tree.indent": 20 (20 as an example of indent space amount).
Utiliser les issues de ces deux plateformes pour avoir des cheatsheets :)
Replace the .com in the project with .dev to open a VS code editor online.
Or the shortcut . (dot) to go straight to this editor !
In this editor you can obviously consult all the sources of the project, but also modify them and push your changes to the github directly.
Donner l'adresse du site en
hxxps://ludovic-bois.com/index.php
afin d'éviter que les gens cliquent sur ce lien rapidement et qu'il soit référencé dans les moteurs de recherche.
Comment pister l'origine d'une requête dans une BDD
A way to render conditionally the attributes of a tag.
Creating an object and setting the attributes as prop of the object if they should be rendered. Then use the spread operator on it:
<script>
export let value = "";
export let id = "";
export let placeholder = "";
export let type = "text";
let conditionalAttributes = {};
if (id) conditionalAttributes.id = id;
if (placeholder) conditionalAttributes.placeholder = placeholder;
if (type) conditionalAttributes.type = type;
</script>
<input {...conditionalAttributes} bind:value={value} />loading=lazyattribute to defer the loading of the image until the user scrolls to them<datalist>element to create native HTML autocomplete- Email, call and SMS links
- Ordered lists
startattribute to change the starting point of an ordered list. <input type="reset" />to get a clear button for the forms<meter>element to display quantitieswindow.openerreturns the original page of atarget="_blank". This can have security and performance implications. Includerel="noopener"orrel="noreferrer"to prevent this.<base target="_blank">in the<head>to open all links in the document in a new tab.- Favicon cache busting by adding a
?v=2to the link of the favicon <details><summary>Summary</summary><p>Details</p></details>downloadattribute to a link download the file instead of navigating to it- Use the
webpimage format to boost performance - Use the
posterattribute to specify an image to be shown while the video is downloading, or until the user hits the play button - Use the
spellcheckattribute to define whether the element may be checked for spelling errors.
👍
The first rule of thumb:
If you’re stuck for over an hour, seek help.
with
When you seek advice, first write down everything you’ve tried.
that as 3 benefits:
- act as a rubber duck debugging
- evidence that there is some kind of structured thought process that has been carried out, and what it was
- saving time explaining the context to someone else
If this is not useful enough, the author recommends to use his formula.
About the workflow with Git and best practices 👍
I will start using it. It seems useful if you give your email address to third-parties or to know where someone got your email from.
Solution: Using 1 subgrid per element inside a grid.
In the console: $0.offsetParent → $0 is the currently set element.
Then we can use the offsetParent object property to find the closest ancestor to that element that has its position set to something other than static.