Skip to content

Instantly share code, notes, and snippets.

View yvan-sraka's full-sized avatar

Yvan Sraka yvan-sraka

View GitHub Profile

----- Git -----

OUTILS : Logiciel de versionning

Pour obtenir de l'aide : man git

MEMENTO commandes Git :

status : Savoir ce que se passe

// ALGO
function code(message, key) {
let coded_message = "";
for (c of message) {
coded_message += String.fromCharCode(
c.charCodeAt() + key
)
}
return coded_message;
// Population de lapins : [1, 1, 2, 3, 5, 8, 13 21 34 55 89 <3 <3 !
// fibonnaci(0) = 1
// fibonnaci(1) = 1
// fibonnaci(2) = 2
// fibonnaci(3) = 3
// fibonnaci(4) = 5
// fibonnaci(10) = 89
/**************** BAD ******************/

Syntax

-> J'écris un truc qui n'est pas du JS

if (x < 5 {

}

Naming / Scoping

// RECURSIVITE //
let hack = function () {
console.log("bouh");
hack();
}
hack();
// Scope
function x() {
let foo = "bar";
}
console.log(foo);
// Namespace

Workshop Algo II the return

Dans l'épisode précédent

max en JS et PHP

-> quasiment pareil

Kesako un algo ???

<!-- HTML CODE -->
<?php
...
?>
<!-- HTML CODE -->

LAMP: Linux Apache MySQL PHP

  • apache2: Handle HTTP Request | nginx
  • php5: Templating language | python | ruby
  • mysql: Local Database (SQL) | postgresql | mongodb | rethinkdb