Devenet Devenet

Liens en vrac

Quelques 337 marque-pages glanés pendant ma navigation sur le Web.

30 résultats pour #développement×

RSS ATOM

Stop naming your variables “flag”: the art of boolean prefixes

https://thatamazingprogrammer.com/posts/stop-naming-your-variables-flag-the-art-of-boolean-prefixes/

1. IS: Identity and State • Use is when describing what something is right now. It usually pairs with an adjective.
   isActive, isDeleted, isEmpty

2. HAS: Containment and Features • Use has when describing ownership or inclusion. It pairs with a noun.
   hasAccess, hasChildren, hasValidationErrors

3. CAN: Capability • Use can to check permissions or potential actions.
   canEdit, canDelete, canRetry

4. SHOULD: Intent • Use should for business rules or decisions the system needs to make. This separates “what we can do” from “what we want to do.”
   shouldRetry, shouldCacheResponse

Forcer ou non le téléchargement d’un document PDF en spécifiant un nom de fichier

https://stackoverflow.com/questions/6293893/how-to-force-files-to-open-in-browser-instead-of-download-pdf

To indicate to the browser that the file should be viewed in the browser:
 Content-Type: application/pdf
 Content-Disposition: inline; filename="filename.pdf"

To have the file downloaded rather than viewed:
 Content-Type: application/pdf
 Content-Disposition: attachment; filename="filename.pdf"

Les sept habitudes des gens super efficaces chez GitHub

https://frank.taillandier.me/2016/11/15/sept-habitudes-productives-chez-github/

1. Professionnel, mais pas formel
2. Livrez tôt, livrez souvent (“ne laissez pas le mieux être l’ennemi du bien”)
3. Si vous remarquez quelque chose, dîtes quelque chose
4. Curiosité et amélioration personnelle
5. Toujours prêt à aider (mais savoir quand dire “non”)
6. Contribuez à l’économie de la valorisation
7. Honnêteté, intégrité et authenticité

L’histoire d’Unicode et son adoption sur le Web

https://jolicode.com/blog/l-histoire-d-unicode-et-son-adoption-sur-le-web

— Go Unicode : soyez inclusif et faites l’effort nécessaire pour supporter les internautes du monde entier.
— Forcez le charset de vos connexions MySQL.
— Arrêtez d’utiliser le charset utf8 sur vos tables, il est mal nommé, obsolète et dangereux → utilisez utf8mb4, c’est le bien.
– Normalisez les contenus important, pour trier, comparer, de façon homogène.
– Forcez l’encodage pour tous vos développeurs (avec un petit EditorConfig par exemple).
– N’utilisez pas utf8_decode et utf8_encode !

The Joel Test: 12 steps to better code

http://www.joelonsoftware.com/articles/fog0000000043.html

The Joel Test

1. Do you use source control?
2. Can you make a build in one step?
3. Do you make daily builds?
4. Do you have a bug database?
5. Do you fix bugs before writing new code?
6. Do you have an up-to-date schedule?
7. Do you have a spec?
8. Do programmers have quiet working conditions?
9. Do you use the best tools money can buy?
10. Do you have testers?
11. Do new candidates write code during their interview?
12. Do you do hallway usability testing?

Font loading revisited with font events

https://www.filamentgroup.com/lab/font-events.html

Chargement “différé” des fonts sur une page web pour un rendu plus rapide.

On charge les fonts via CSS, comme habituellement.
On définit les éléments avec ces polices comme enfant de .fonts-loaded.
Via une API JavaScript, on détecte quand les fonts sont chargées et prêtes, et on ajoute la classe .fonts-loaded à l’élément body : les polices sont affichées.
→ Pas de page sans police ou un blanc entre le chargement des polices.

Dans le même genre : http://www.zachleat.com/web/foft/