Quelques 337 marque-pages glanés pendant ma navigation sur le Web.
https://www.twilio.com/blog/html-attributes-two-factor-authentication-autocomplete
http://www.diegoacuna.me/how-to-run-a-script-as-a-service-in-raspberry-pi-raspbian-jessie/
Un article qui explique comment très simplement intégrer un script shell sous forme de service dans systemd.
‣ via
https://sebsauvage.net/links/?rTgZEQ
https://fractalwrench.co.uk/posts/playing-apk-golf-how-low-can-an-android-app-go/
Comment passer de 1,5 Mo à 1757 o pour un APK d’une même application Android…
https://code.tutsplus.com/fr/tutorials/the-30-css-selectors-you-must-memorize--net-16048
http://bookmarks.ecyseo.net/?HA8-vg
La fonction suivante est celle qui fonctionne le mieux avec tous les navigateurs puisqu’elle ouvre un nouvel onglet avant d’ouvrir l’URL :
function openNew(url) {
var otherWindow = window.open();
otherWindow.opener = null;
otherWindow.location = url;
}
Lire aussi
https://mathiasbynens.github.io/rel-noopener/
http://www.linuxtricks.fr/wiki/bash-memo-pour-scripter
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?
http://blog.wax-o.com/2015/05/an-alternative-to-if-else-and-switch-in-javascript/
Comment éviter un switch ou un if/else en JavaScript : avec un tableau.
let values = {
a: 1,
b: 2,
};
let foo = values[ bar ] || 3;
est équivalent à
let foo = '';
if ( bar === 'a' )
foo = 1;
else if ( bar === 'b' )
foo = 2;
else
foo = 3;
http://lehollandaisvolant.net/?id=20160407164815
Comment faire un loader uniquement en CSS :)
http://mockingeye.com/blog/2013/01/22/reading-everything-stdin-in-a-bash-script/
#!/bin/bash
VALUE=$(cat)
echo "$VALUE"
‣ via
https://www.ecirtam.net/links/?Vvwb4g
http://webdesign.tutsplus.com/tutorials/how-to-animate-festive-svg-icons-with-css--webdesign-17658
Comment animer avec du CSS des dessins SVG
http://lehollandaisvolant.net/?mode=links
// Initial state
var scrollPos = 0;
// adding scroll event
window.addEventListener('scroll', function(){ scrolling() });
// the function : compares the new scrolling state with the previous
// (this allows detecting either “up” or “down” scrolling)
// then saves the new in the $previous for the next iteration.
function scrolling() {
if ((document.body.getBoundingClientRect()).top > scrollPos) {
console.log('scrolling DOWN');
} else {
console.log('scrolling UP');
}
scrollPos = (document.body.getBoundingClientRect()).top;
}
http://bookmarks.ecyseo.net/?rZSKHA
//specify the email address you are sending to, and the email subject
$email = 'email@example.com';
$subject = 'Email Subject';
//create a boundary for the email. This
$boundary = uniqid('np');
//headers - specify your from email address and name here
//and specify the boundary for the email
$headers = "MIME-Version: 1.0\r\n";
$headers .= "From: Your Name \r\n";
$headers .= "To: ".$email."\r\n";
$headers .= "Content-Type: multipart/alternative;boundary=" . $boundary . "\r\n";
//here is the content body
$message = "This is a MIME encoded message.";
$message .= "\r\n\r\n--" . $boundary . "\r\n";
$message .= "Content-type: text/plain;charset=utf-8\r\n\r\n";
//Plain text body
$message .= "Hello,\nThis is a text email, the text/plain version.
\n\nRegards,\nYour Name";
$message .= "\r\n\r\n--" . $boundary . "\r\n";
$message .= "Content-type: text/html;charset=utf-8\r\n\r\n";
//Html body
$message .= "
Hello,
This is a text email, the html version.
Regards,
Your Name";
$message .= "\r\n\r\n--" . $boundary . "--";
//invoke the PHP mail function
mail('', $subject, $message, $headers);
http://emails.hteumeuleu.fr/2016/02/fab-four-emails-responsive-sans-media-queries/
Solution « responsive » pour afficher 4 colonnes sur les webmails desktop et deux colonnes sur les webmails mobiles.
https://www.dadall.info/blog/index.php?article482/bonnes-pratiques-de-deploiement-php-en-2015
https://www.php.net/manual/en/function.gethostbynamel.php
Récupération de la liste d’adresses IP v4 à partir d’un nom de domaine.
Voir aussi :
• gethostbyname() - Get the IPv4 address corresponding to a given Internet host name
• gethostbyaddr() - Get the Internet host name corresponding to a given IP address
• checkdnsrr() - Check DNS records corresponding to a given Internet host name or IP address
• getmxrr() - Get MX records corresponding to a given Internet host name
http://bookmarks.ecyseo.net/?Nv-seA
onclick="window.setTimeout('location.assign(location.href)',2000);"
http://lehollandaisvolant.net/?mode=links&id=20150731185744
#container {
max-height: 100%;
}
#container img {
/* Keeps image from going outside the screen */
max-height: 100%;
max-width: 100%;
/* Keeps image from beeing distorted */
height: auto;
width: auto;
/* centering horizontally AND vertically */
/* 50% of container */
position: relative;
top: 50%;
left: 50%;
/* 50% of image */
transform: translate(-50%,-50%);
}
http://lehollandaisvolant.net/?id=20150528170631
Comment transformer un tableau en un tableau responsive lisible sur des petits écrans
@media (max-width: 500px) {
/* table + tbody are blocks */
#mytable, #mytable tbody {
display: block;
width: 100%;
}
/* each row becomes table */
#mytable tr {
display: table;
margin-top: 20px;
width: 100%;
border-spacing: 5px 0;
}
/* each cell becomes a row (of the row that had become a table) */
#mytable tr td {
display: table-row;
width: 100%;
}
}
http://emails.hteumeuleu.fr/2014/07/css-triangles/
Comment faire des triangles sans image avec un peu de CSS.