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 / 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"
@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 / 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 / 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 / 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 / IndianaJones.java
Created August 30, 2019 08:47
Java 03 : Variables
class IndianaJones {
public static void main(String... args) {
String movieTitle = "Indiana Jones and the Last Crusade";
boolean isSeen = true;
int releaseYear = 1989;
float userRatings = 8.2f;
import sys
import math
# Auto-generated code below aims at helping you parse
# the standard input according to the problem statement.
n = int(input()) # Number of elements which make up the association table.
q = int(input()) # Number Q of file names to be analyzed.
mime_type_map = {}
@stephanBerger
stephanBerger / Senpai.java
Last active September 11, 2019 07:43
Java 01 : Le JDK
class Senpai{
public static void main(String[] args) {
//Affichage de la phrase Notice me Senpai
System.out.println("Notice me Senpai");
//Fin du programme
}
}
@stephanBerger
stephanBerger / index.html
Last active August 29, 2019 08:04
09 - Bootstrap : le système de grilles
<!doctype html>
<html lang="fr">
<head>
<title>le Grand Œil</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<link rel="stylesheet" href="style.css">
@stephanBerger
stephanBerger / index.html
Last active September 1, 2019 18:20
07 - CSS : responsive web design
<!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>