Skip to content

Instantly share code, notes, and snippets.

View nclarx's full-sized avatar

Nick Clark nclarx

View GitHub Profile
nclarx / filterSortPipeHW17.txt
Last active August 13, 2017 05:19
Filter/Sort Pipe for History Week 2017 App
import {Pipe, PipeTransform} from '@angular/core';
import {IEvent} from './event';
import * as moment from 'moment/moment';
export const EventFilter: (value: IEvent[], region: string, dayOfWeek: string, showFeaturedEvents: boolean) => IEvent[] = function (value: IEvent[], region: string, dayOfWeek: string, showFeaturedEvents: boolean) {
return value.filter(event => {
let today = moment();
let eventDate = moment(, 'YYYY-MM-DD');
if (eventDate.isAfter(today)) {
if (region !== null) {
nclarx / your-component.component.ts
Created September 28, 2017 11:16
Example of Subscribe to Property
import {Component, OnDestroy, OnInit} from '@angular/core';
import {User} from './user'; // Assuming you have a class for user =====
import {Subscription} from 'rxjs/Subscription';
import {AngularFireDatabase, FirebaseListObservable, FirebaseObjectObservable} from 'angularfire2/database';
selector: 'your-component',
template: `
<h1>{{ (user | async)?.name }}</h1>
<h1>{{ (user | async)?.price }}</h1>
nclarx / event-emitter.ts
Last active January 10, 2019 09:36
Event Emitter
public class ParentComponent {
handleEventFromChild($event: Event): never {
// Do something with event...
nclarx / IAppState.ts
Last active January 12, 2019 11:53
import {IWorkflowConfig} from "./iWorkflowConfig";
import {IMarkdown} from "./iMarkdown";
import {Browser} from "puppeteer";
import {Command} from "commander";
export interface IAppState {
workflowConfig?: IWorkflowConfig;
template?: string;
styles?: string;
markdownFiles?: IMarkdown[];
<p class="test-class">This is a test of HTML</p>
nclarx / Dell XPS 15 9560 Manjaro Setup instructions
Created March 21, 2019 04:36 — forked from meirbon/Dell XPS 15 9560 Manjaro Setup instructions
Small, quick guide to set up Manjaro on the XPS 15 9560
# 1. First of all of course get Manjaro:
# I recommend using Etcher to copy the image to your USB:
# 2. Before installing make sure:
# - Secure boot is disabled in BIOS
# - Your SSD, HDD or NVME drive is set to AHCI instead of RAID
# - Fastboot should be on Auto or minimal, but this shouldn't matter to much
nclarx / app.js
Last active November 28, 2019 23:03
'use strict'
function getWithPromises() {
return new Promise((resolve, reject) => {
.then((data) => { // do something async
resolve(data.json()) // once data is returned, resolve
.catch((err) => {
reject(err) // or reject if there's an error
nclarx /
Last active April 24, 2020 09:45
Config Details for i3 Manjaro

Config Details for i3 Manjaro

Persisting Nvidia Graphic Card Settings

My excellent GeForce GTX 980, still going strong after a number of years, uses the non-free drivers on Manjaro.

The issue with Manjaro out of the box seems to be that the nvidia-settings app doesn't save the monitor config you set, and when you reboot you end up with the default settings.

To solve this issue:

nclarx / app.component.html
Created January 14, 2021 08:51
Example Demonstrating how to Render List of Orders in Angular Component from Firebase Realtime DB w/ Auth using AngularFire
<ul *ngIf="orders$ | async"> <!-- The *ngIf will hide the whole list until the data has arrived-->
<li *ngFor="let order of orders$ | async"> <!-- The *ngFor will loop over and create list items for the orders once the data has arrived-->
{{order.packageName}}: {{order.packageDescription}}