array := []int{1, 2, 3, 4}
fmt.Println("Full array", array) // Full array [1 2 3 4]
fmt.Println("Skip 2 first", array[2:]) // Skip 2 first [3 4]
fmt.Println("2 first", array[:2]) // 2 first [1 2]
This file contains 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
<header> | |
<button (click)="lang.next('fr')">FR</button> | |
<button (click)="lang.next('en')">EN</button> | |
</header> |
This file contains 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
export function createTranslateLoader(http: HttpClient) { | |
return new TranslateHttpLoader(http, './assets/i18n/home/', '.json'); | |
} | |
@NgModule({ | |
imports: [ | |
CommonModule, | |
HomeRoutingModule, | |
TranslateModule.forChild({ | |
loader: { |
This file contains 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
@Component({ | |
selector: 'i-home', | |
templateUrl: './home.component.html', | |
styleUrls: ['./home.component.scss'] | |
}) | |
export class HomeComponent implements OnInit { | |
lang$: Observable<string>; | |
constructor(private readonly translate: TranslateService, |
This Node.js script automates the process of updating your project's dependencies while also running tests to ensure that each update doesn't break your code.
Generated with the help of ChatGPT by OpenAI.
- Checks for outdated npm packages in your project.
- Sorts the packages by update type (patch, minor, major).
This README outlines the implementation details of passing JWT tokens in a React application using React Router. This is crucial for managing access controls and secure communication between the client and server.
The application utilizes React Router for navigation and Auth0 for authentication. The main focus is on how to effectively pass JWT tokens retrieved from Auth0 to various components and routes.
OlderNewer