Skip to content

Instantly share code, notes, and snippets.

View stephanBerger's full-sized avatar
💭
I may be slow to respond.

sBerger stephanBerger

💭
I may be slow to respond.
  • CAF des Bouches-du-Rhône
  • Marseille
View GitHub Profile
@stephanBerger
stephanBerger / Movies.java
Last active September 10, 2019 07:54
Java 04 : Tableaux et itération
import java.util.Arrays;
public class Movies {
public static void main(String[] args) {
String[] indianaMovies = {
"Indiana Jones and the Kingdom of the Crystal Skull",
"Indiana Jones and the Last Crusade",
@stephanBerger
stephanBerger / Decipherer.java
Last active September 10, 2019 09:37
Java 05 : Méthodes
public class Decipherer {
public static StringBuilder decryptString (String message) {
StringBuilder decryptedMessage;
//Calcule la longueur de la chaîne et divise-la par 2, tu obtiendras ainsi le "chiffre-clé".
int keyNumber = message.length()/2;
@stephanBerger
stephanBerger / index.html
Created September 11, 2019 08:38
08 - CSS : Flexbox
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0' />
<title>Find the precious!</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
@stephanBerger
stephanBerger / Boat.java
Created September 11, 2019 10:35
Java 07 : Héritage
public class Boat extends Vehicule{
public Boat(String brand, int kilometers) {
super(brand, kilometers);
}
@Override
public String doStuff() {
@stephanBerger
stephanBerger / bonjour.sh
Created September 11, 2019 20:02
Introduction au Shell
#!/bin/bash
#on affecte le nom l'utilisateur connecté à la variable utilisateur
#avec la command whoami, entre back-quotes, shell exécute la commande
utilisateur=`whoami`
#on teste si la variable $# contient 0 paramètre alors
#on affiche bonjour et le nom de l'utilisateur connecté
if [ $# = "0" ]; then
echo "Bonjour $utilisateur"
(base) rencho@sb-7745G:/home/workspace$ ls -aR
.:
. .. readme xml
./xml:
. .. index.xml
(base) rencho@sb-7745G:/home/workspace$ ll -aR
.:
total 12
drwxr-xr-x 3 root root 4096 sept. 11 22:28 ./
@stephanBerger
stephanBerger / history
Created September 12, 2019 18:46
Linux - Terminal 2 - Fichiers et répertoires
1093 cd quetes/
1094 mkdir -p quetes/shell/legumes quetes/shell/fruits
1095 ls
1096 mkdir quetes/shell/effacez-moi quetes/shell/delete-me
1097 ls quetes/shell/
1098 rmdir quetes/shell/effacez-moi/ quetes/shell/delete-me/
1099 cd ~/quetes/shell
1100 cd quetes/shell
1101 touch pomme
1102 touch poire
# Git is our friend !!
### What is git ?
First of all, [GitHub](https://hackernoon.com/tagged/github) is _not_ git. Many people understandably confuse the two. [GitHub](https://github.com/) is a website for hosting projects that _use_ git.
Git is a type of [**version control**](https://hackernoon.com/tagged/version-control) **system** (VCS) that makes it easier to track changes to files. For example, when you edit a file, git can help you determine exactly _what_ changed, _who_ changed it, and _why_.
It’s useful for coordinating work among multiple people on a project, and for tracking progress over time by saving “checkpoints”. You could use it while writing an essay, or to track changes to artwork and design files.
@stephanBerger
stephanBerger / history
Created September 13, 2019 11:27
Linux Terminal 2
481 wget https://github.com/bhubr/bhubr.github.io/raw/master/wild/planets.zip
482 unzip planets.zip
483 eog planets/
484 ls
485 cd planets
486 ls
487 mkdir real fictional inhabited
488 ls
489 cd real/
@stephanBerger
stephanBerger / history.txt
Created September 14, 2019 09:38
Linux Terminal 3
754 grep France,2019,PHP wilders.txt | wc -l > php_france_2019.txt
755 grep JavaScript wilders.txt | grep "Toulouse\|Biarritz" > javascript_biarritz_toulouse.csv
756 history | tail -n 5 > history.txt