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
Generating a new SSH key | |
Open Terminal. | |
Paste the text below, substituting in your GitHub email address. | |
> ssh-keygen -t rsa -b 4096 -C "[email protected]" | |
This creates a new ssh key, using the provided email as a label. | |
Generating public/private rsa key pair. | |
When you're prompted to "Enter a file in which to save the key," press Enter. This accepts the default file location. |
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 class ExtendedHttpService extends Http { | |
constructor(backend: XHRBackend, defaultOptions: RequestOptions) { | |
super(backend, defaultOptions); | |
} | |
request(url: string, options?: RequestOptionsArgs): Observable<Response> { | |
return super.request(url, options).catch((error: Response) => { | |
if (error.status === 0) { | |
this._router.navigateByUrl('/no-internet', { skipLocationChange: true }); | |
let timer = 1000; // in milliseconds | |
Observable.interval(timer * 2).subscribe(x => { |
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 { environment } from 'environments/environment'; | |
import { HttpClientTestingModule } from '@angular/common/http/testing'; | |
import { TestBed } from '@angular/core/testing'; | |
import * as fromModels from '@models'; | |
import { Actions } from '@ngrx/effects'; | |
import { cold, hot } from 'jasmine-marbles'; | |
import { empty, Observable, of, BehaviorSubject } from 'rxjs'; | |
import * as fromActions from '../actions/trending.actions'; | |
import * as fromEffects from './trending.effects'; |
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
cleanPerMonth( | |
data: { | |
counter: number; | |
month: number; | |
year: number; | |
}[], | |
numberOfMonths: number | |
) { | |
const result = []; | |
const everyMonth = []; |
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
This post links my 3Box profile to my Github account! Web3 social profiles by 3Box. | |
✅ did:muport:QmYnGmzou2bvhXAr4TpdXdW9uJe5K2671x6jHE7p4cwZsp ✅ | |
Create your profile today to start building social connection and trust online at https://3Box.io/ |
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
This post links my 3Box profile to my Github account! Web3 social profiles by 3Box. | |
✅ did:muport:QmeqQETUT587avA6JXiBTiTpgif8PzcLwsoVDyqDr2krqx ✅ | |
Create your profile today to start building social connection and trust online at https://3Box.io/ |
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
This was easy because I’d installed QEMU earlier on my system via Homebrew, so it was easy to convert the VMDK (the VMware disk image) to a RAW image image: | |
> qemu-img convert -f vmdk puredarwinxmas.vmdk pd.raw | |
This captures the contents of the VMware image into a raw image in some (unbeknownst to me) format. You can then write this to an ISO file: | |
> dd if=pd.raw of=pd.iso | |
That’s it. You can then mount this ISO, put it up for download, or whatever. This shouldn’t be limited to PureDarwin, and should work for most VMware disk images as long as it is stored as a VMDK file. |
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 dirtyCheck<U>(source: Observable<U>) { | |
let subscription: Subscription; | |
let isDirty = false; | |
return function <T>(valueChanges: Observable<T>): Observable<boolean> { | |
const isDirty$ = combineLatest( | |
source, | |
valueChanges, | |
).pipe( | |
debounceTime(300), |
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 dirtyCheck<U>(source: Observable<U>) { | |
return function<T>(valueChanges: Observable<T>): Observable<boolean> { | |
const isDirty$ = combineLatest( | |
source, | |
valueChanges, | |
).pipe( | |
debounceTime(300), | |
map(([a, b]) => isEqual(a, b) === false), | |
startWith(false), |
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({ | |
template: ` | |
<form> | |
... | |
<button (click)="submit()" *ngIf="isDirty$ | async">Save</button> | |
</form> | |
` | |
}) | |
export class SettingsComponent { | |
settings = new FormGroup({...}); |
OlderNewer