Skip to content

Instantly share code, notes, and snippets.

View christo8989's full-sized avatar

Christopher Jeffery christo8989

View GitHub Profile
@christo8989
christo8989 / parameter.service.ts
Created March 16, 2020 16:21
Angular ParameterService
import { Injectable } from "@angular/core"
import { ActivatedRoute, ActivatedRouteSnapshot } from "@angular/router"
@Injectable({ providedIn: "root" })
export class ParameterService {
constructor(private route: ActivatedRoute) { }
get(property: string, defaultValue: string = null): string {
const value = this.findProperty(this.route.root.snapshot, property)
@christo8989
christo8989 / debounce.directive.ts
Created March 20, 2020 22:08
Angular Directives
import {
Directive,
Input,
OnDestroy,
EventEmitter,
Output,
} from '@angular/core';
import { NgModel } from '@angular/forms';
import { Subscription, Observable } from 'rxjs';
import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
import { OperatorFunction, SchedulerLike, concat } from "rxjs";
import { async } from "rxjs/internal/scheduler/async";
import { debounceTime, publish, take } from "rxjs/operators";
export function debounceTimeAfter<T>(
amount: number,
dueTime: number,
scheduler: SchedulerLike = async,
): OperatorFunction<T, T> {
return publish(value =>
@christo8989
christo8989 / .gitconfig
Created July 1, 2020 00:10 — forked from ddddavidmartin/.gitconfig
Git checkout alias that accepts regular expressions
[alias]
co = !"find_and_checkout_branch(){\
for last; do true; done ; \
pattern='^/.*/$' ;\
if [[ $# -eq 1 && $last =~ $pattern ]] ;\
then \
branch_pattern=`echo $last | sed -e 's/^\\///' -e 's/\\/$//'` ;\
branch=`git for-each-ref --sort=-committerdate --format='%(refname:short)' refs/heads/ | grep -E -i $branch_pattern | head -n1` ;\
if [[ $branch ]] ; then \
git checkout $branch ;\
@christo8989
christo8989 / nuphy_air75_v2_keybindings.json
Last active March 24, 2024 23:15
NuPhy Air75 V2 Key Bindings
{
"name": "NuPhy Air75 V2",
"macros": ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""],
"layers": [
[
"KC_ESC",
"KC_F1",
"KC_F2",
"KC_F3",
"KC_F4",