Skip to content

Instantly share code, notes, and snippets.

View Coly010's full-sized avatar

Colum Ferry Coly010

View GitHub Profile
export const NPM_SCOPE_REGEX = new RegExp(/^@{1}(\w)+\/{1}(?!\/)/);
@Coly010
Coly010 / Prompt.tsx
Created June 12, 2023 14:13
Changing Signal Value in Event Handler throwing Qwik Error
import { component$, useSignal, useStore } from '@builder.io/qwik';
import { Button } from '../button/button';
import {
I18nMappings,
PromptOption,
} from '@nx-toolkit/shared/data-access/transformer';
type PromptCategories = 'generate' | 'improve' | 'feedback';
type MultiPromptBox = Record<PromptCategories, PromptOption[]>;
@Coly010
Coly010 / run-interactive-command.impl.ts
Created April 14, 2023 11:47
Run Interactive Commands Executor for Nx
import { exec } from 'child_process';
import * as path from 'path';
import * as yargsParser from 'yargs-parser';
import { env as appendLocalEnv } from 'npm-run-path';
import { ExecutorContext } from '@nrwl/devkit';
import * as chalk from 'chalk';
export const LARGE_BUFFER = 1024 * 1000000;
async function loadEnvVars(path?: string) {
const obs$ = of('my test value');
obs$.pipe(debug()).subscribe();
// OUTPUT
// CONSOLE
// my test value
//We can add a label to the logs:
const obs$ = of('my test value');
obs$.pipe(debug('Obserable A')).subscribe();
// OUTPUT:
// Obserable A my test value
// We can label it using the config object syntax:
const obs$ = of('my test value');
// Examples
// We can use it on it's own to simply log out values to the console
const obs$ = of('my test value');
obs$.pipe(debug()).subscribe();
// OUTPUT:
// my test value
We can also set up our own notification handlers if we prefer:
const mappedInv$ =
// Gets all docs
this.invService.getAll().pipe(
// Stream each element of the array
mergeMap((inventory) => from(inventory)),
// Using each element of the array, do your next action
mergeMap((inventoryItem: InventoryItem) =>
// This use case involved getting more details from a difference collection
this.itemService.getAsync(inventoryItem.itemId).pipe(
take(1),
@Coly010
Coly010 / launch.json
Created April 7, 2020 11:01
Angular Launch VSCoce
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch Chrome against localhost",

Subject / Problem