This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
il est possible de récupérer d'autre informations telles que l'index de l'élément : | |
index : position de l'élément. | |
odd : indique si l'élément est à une position impaire. | |
even : indique si l'élément est à une position paire. | |
first : indique si l'élément est à la première position. | |
last : indique si l'élément est à la dernière position. | |
<ul> | |
<li *ngFor="let book of bookList; let index = index; let isFirst = first; let isOdd = odd;"> | |
<span>{{ index }}</span> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import './product_manager.dart'; | |
// This method return anything | |
// void main() { | |
// runApp(MyApp()); | |
// } | |
// Sugar syntax only with one statement | |
void main() => (runApp(MyApp())); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
class AppTheme { | |
static const TextStyle title_h1 = TextStyle( | |
fontFamily: "WorkSans", | |
color: Colors.black, | |
fontSize: 38, | |
fontWeight: FontWeight.w600, | |
letterSpacing: 1.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user = { "name": "Ed", "email": "john@yahoo.com", | |
"age": 20, "purchases": [1, 2, 3, 4]} | |
user["name"] = "anna | |
print(user) | |
for key in user: | |
print(key) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker pull [imageName] # Pull an image from a registry | |
docker run [imageName] # Run containers | |
docker run -d [imageName] # Detached mode | |
docker start [containerName] # Start stopped containers | |
docker ps # List running containers | |
docker ps -a # List running and stopped containers# | |
docker stats # List running containers with memory usage | |
docker stop [containerName] # Stop continers | |
docker kill [containerName] # Kill Containers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// jQuery, select all instances of .box | |
$(".box"); | |
// Instead, select the first instance of .box | |
document.querySelector(".box"); | |
// …or select all instances of .box | |
document.querySelectorAll(".box"); | |
------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function useFetch(url, defaultResponse) { | |
const [data, setData] = useState(defaultResponse); | |
async function getDataFromAPI() { | |
try { | |
const res = await fetch(url); | |
const data = await res.json(); | |
setData({ | |
isLoading: false, | |
data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.sub.subject | |
public enum LoggingLevel { | |
PENDING(1, "1"), PROCESSING(2), PROCESSED(3); | |
private int i; | |
private LoggingLevel(int i) { | |
this.i = i; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// HERITAGE | |
L'héritage est un moyen de créer de nouvelles classes à partir de classes déjà existantes afin de réutiliser leurs attributs et leurs comportements. | |
// ENCAPSULATION | |
// POLYMORPHISME |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// list s3 bucket | |
aws s3 ls | |
// list all folders and objects in bucket | |
aws s3 ls s3://<bucket_name> | |
// list all folders and object in folder | |
aws s3 ls s3://<bucket_name>/<folder> | |
// Dl object to my desktop |
OlderNewer