Skip to content

Instantly share code, notes, and snippets.

View pniel-cohen's full-sized avatar

Pniel (Pini) Cohen pniel-cohen

View GitHub Profile
@katowulf
katowulf / app.component.ts
Last active February 3, 2021 15:09
Dynamically set page title based on active route in Angular 4
// This can probably be simplified somehow. Not sure why I need to add it in the component to init the service.
import { Component, OnInit } from '@angular/core';
import {TitleService} from "./@core/utils/title.service";
@Component({...})
export class AppComponent implements OnInit {
constructor(private titleService: TitleService) {...}
@mandiwise
mandiwise / Count lines in Git repo
Last active July 4, 2024 16:56
A command to calculate lines of code in all tracked files in a Git repo
// Reference: http://stackoverflow.com/questions/4822471/count-number-of-lines-in-a-git-repository
$ git ls-files | xargs wc -l