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
# Compilation files | |
bin/ | |
obj/ | |
*.exe | |
*.dll | |
*.pdb | |
*.cache | |
*.ilk | |
*.ncb | |
*.suo |
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
// PSEUDO CODE | |
// Function TwoSumFinalIteration(nums : List<int>, target : int) : List<int> | |
// Var | |
// collection : Dictionary<int, int> | |
// value : int | |
// Start | |
// If nums.Length < 2 OR nums.Length > 10000 OR target < -1000000000 OR target > 1000000000 Then | |
// Display "Constraints not respected!" |
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
// PSEUDO CODE | |
// Function ConvertIntToString(x : int) : List<string> | |
// Var convertedInt: List<string> | |
// Start | |
// convertedInt <- new List<string>() | |
// Foreach char in x.ToString() | |
// Append char.ToString() to convertedInt |
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
namespace csharp_method | |
{ | |
public class RandomMethod | |
{ | |
public void DisplayRandomNumbers() | |
{ | |
Random random = new Random(); | |
for (int i = 0; i < 5; 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
// 1 - Service "newsletter": call the DB Table named "newsletter" and get email addresses form this Table with HttpClient method | |
import { Injectable } from '@angular/core'; | |
import { HttpClient } from '@angular/common/http'; | |
import { Observable, map, pipe, tap } from 'rxjs'; | |
import { Newsletter } from '../model/newsletter'; | |
@Injectable({ | |
providedIn: 'root' | |
}) |
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
// For list and details logic | |
ngOnInit() { | |
const figurineId: string | null = this.route.snapshot.paramMap.get("id"); | |
if(figurineId) { | |
this.figurineService.getFigurineById(+figurineId).subscribe(figurine => { // Get dynamic titles in detail section | |
this.figurine = figurine; | |
this.initTitle(figurine); | |
}); | |
} |
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 { inject } from '@angular/core'; | |
import { Router } from '@angular/router'; | |
import { AuthService } from './auth.service'; | |
// Refactored with Guard Function and inject() | |
export const AuthGuard = () => { | |
const authService = inject(AuthService); | |
const router = inject(Router); | |
if(authService.isLoggedIn) { |
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 { Component, OnInit } from '@angular/core'; | |
import { AuthService } from '../auth.service'; | |
import { Router } from '@angular/router'; | |
@Component({ | |
selector: 'app-login', | |
templateUrl: './login.component.html', | |
styles: [ | |
] | |
}) |
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
<div class='row'> | |
<div class="col s12 m4 offset-m4"> | |
<div class="card hoverable"> | |
<div class="card-content center"> | |
<span class="card-title">Page de connexion</span> | |
<p><em>{{message}}</em></p> | |
</div> | |
<form #loginForm="ngForm"> | |
<div> | |
<label for="name">Name</label> |
NewerOlder