Skip to content

Instantly share code, notes, and snippets.

RESTful

Une API se dira "RESTful" quand elle va respecter certaines conventions.

C'est presque comme un label de qualité, que les développeurs vont aimer. Par ex, dans une API permettant de laisser des commentaires, pour CREER un nouveau commentaire, une API RESTful utilisera le verbe POST ainsi qu'un nom de route au pluriel, soit : POST /comments.

Bien sûr, elle aurait pu choisir autre chose, comme une route au singulier, mais par convention elle tâchera de respecter le pluriel. Comme ça, elle fera plaisir aux développeurs utilisant son API, qui s'y retrouveront plus facilement par habitude de toujours retrouver cette convention entre les différentes APIs qu'ils utiliseront.

La liste complète des conventions RESTful sont :

@abernier
abernier / index.html
Last active January 24, 2019 15:30
mon template de page web responsive
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width,minimum-scale=1,maximum-scale=1,initial-scale=1">
<title></title>
<link rel="stylesheet" href="styles.css">
</head>
<body id="accueil">
First Header Second Header
Content from cell 1 Content from cell 2
Content in the first column Content in the second column
@abernier
abernier / montemplate.html
Last active November 6, 2018 11:02
mon template de page web
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
@abernier
abernier / boiler.html
Created October 1, 2018 07:31
My HTML boilerplate
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<!--<link rel="stylesheet" href="">-->
</head>
<body>
@abernier
abernier / mymod.mjs
Last active September 15, 2018 03:39
// Default export
export default () => {
let greetings = `Hi from the default export!`
console.log(greetings);
return greetings;
};
// Named export `doStuff`
export const doStuff = () => {
function rateLimit(limitCount, limitInterval, fn) {
var fifo = [];
// count starts at limit
// each call of `fn` decrements the count
// it is incremented after limitInterval
var count = limitCount;
function call_next(args) {
setTimeout(function() {
@abernier
abernier / index.html
Created May 17, 2018 09:22
boiler page web vide
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>hello</title>
</head>
<body>
Bonjour !
</body>
</html>

ffmpeg installation script for mac

INSTALL

curl -o- https://cdn.rawgit.com/abernier/bbe6e3f8fa2b96b593731d55956a09a8/raw/89b3c4648f93f99a382f7a674af07bdabd0017cc/ffmpeg-4.0-install.sh | sh