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
import { Injectable } from '@angular/core'; | |
import { LocalStorage } from '@ngx-pwa/local-storage'; | |
import { Observable } from 'rxjs'; | |
import { map } from 'rxjs/operators'; | |
@Injectable() | |
export class PreferencesService { | |
constructor(private localStorage: LocalStorage) { | |
} |
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
describe('isPalindrome', () => { | |
describe('when provided a palindrome', () => { | |
describe('consisting of letters', () => { | |
it('should classify `"racecar"` as a palindrome'); | |
describe('ignoring case', () => { | |
it('should classify `"Racecar"` as a palindrome'); | |
}); | |
describe('ignoring spaces', () => { | |
it('should classify `"taco cat"` as a palindrome'); | |
}); |
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
describe('isInteger', () => { | |
describe('when provided an integer value', () => { | |
it('should classify 5 as an integer'); | |
it('should classify -5 as an integer'); | |
it('should classify 0 as an integer'); | |
}); | |
describe('when provided a numerical value that is not an integer', () => { | |
it('should classify 3.14 as not an integer'); | |
it('should classify -3.14 as not an integer'); | |
it('should classify NaN as not an integer'); |
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
/** | |
* Returns whether the given value is an integer | |
* @param value the value to test | |
* @returns whether the value is an integer | |
*/ | |
export function isInteger(value) { | |
return Math.floor(value) == value; | |
} |
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
joeskeen@DESKTOP /mnt/c/code/sandbox/bug-repro | |
$ git clone [email protected]:v3/joeskeen/Test%20Project/With%20File%20Size%20Restriction | |
Cloning into 'With%20File%20Size%20Restriction'... | |
warning: You appear to have cloned an empty repository. | |
Checking connectivity... done. | |
joeskeen@DESKTOP /mnt/c/code/sandbox/bug-repro | |
$ git clone [email protected]:v3/joeskeen/Test%20Project/Without%20File%20Size%20Restriction | |
Cloning into 'Without%20File%20Size%20Restriction'... | |
warning: You appear to have cloned an empty repository. |
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
import { PipeTransform, Pipe } from '@angular/core'; | |
import * as changeCase from 'change-case'; | |
type TransformFn = (val: string) => string; | |
@Pipe({ name: 'joeCase', pure: true }) | |
export class CasePipe implements PipeTransform { | |
/** | |
* changes the case of a value | |
* @param value the value to change the case of |
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
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
export PS1="\n\[\033[0;92m\]\u@\h\[\033[0m\] \[\033[32m\]\w\[\033[33m\]$(parse_git_branch)\[\033[00m\]\n\[\033[0;96m\]$\[\033[0m\] " |
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
'use strict'; | |
export async function fromNoErrCallback<TResult>(func: Function, thisArg: any, args?: any) { | |
return toPromise<TResult>(func, thisArg, args, createNoErrCallback); | |
} | |
export async function fromErrCallback<TResult>(func: Function, thisArg: any, args?: any) { | |
return toPromise<TResult>(func, thisArg, args, createErrCallback); | |
} |
NewerOlder