Skip to content

Instantly share code, notes, and snippets.

View toddwseattle's full-sized avatar

Todd Warren toddwseattle

View GitHub Profile
@toddwseattle
toddwseattle / func-help.ps1
Created February 4, 2019 21:17
Powershell Fragment to make debugging firebase functions with the google cloud functions emulator easier
# To use from command line . .\func-help.ps1 Start-FBFuncDeployDebug
# (c) Todd Warren 2018 free for all to use with attribution
function Start-FBFuncDeployDebug {
Param( [parameter(Position = 0, Mandatory = $true)][String]$functionName, [parameter(Position = 1, Mandatory = $false)][Int32]$timeout = 600)
$fdeploy = "functions deploy " + $functionName + " --trigger-http --timeout " + $timeout + 's'
$finspect = "functions inspect " + $functionName + " --pause"
Write-Output $fdeploy
Write-Output $finspect
Invoke-Expression -Command $fdeploy
Invoke-Expression -Command $finspect
@toddwseattle
toddwseattle / firebase.json
Created June 17, 2019 22:29
Example firebase.json for use with nx.
{
"functions": {
"source": "/",
"predeploy": ["npm run build functions"]
},
"hosting": {
"public": "dist/apps/angapp",
"ignore": ["firebase.json", "**/node_modules/**"],
"rewrites": [{ "source": "**", "destination": "/index.html" }]
}
@toddwseattle
toddwseattle / replace.build.js
Created July 16, 2019 16:10
Script to update environment.prod.ts during build to match npm semver
/**
* replace.build.js: puts the semver from package.json in angular environment.prod.ts
* see: http://www.bilyachat.com/2017/01/angular-2-build-version.html
*/
var replace = require("replace-in-file");
var package = require("./package.json");
var buildVersion = package.version;
const options = {
files: "src/environments/environment.prod.ts",
from: /version: \"(.*)\"/g,
@toddwseattle
toddwseattle / cloudSettings
Last active August 24, 2020 00:50
vscode debug configuration for an nx configuration with jest and vscode-jest extension
{"lastUpload":"2020-08-24T00:50:10.434Z","extensionVersion":"v3.4.3"}
@toddwseattle
toddwseattle / quick-ref-jekyll-markdown.md
Last active January 3, 2020 14:58 — forked from roachhd/quick-ref-jekyll-markdown.md
Jekyll Markdown Quick Reference

#Jekyll Markdown Quick Reference

####Write in simply awesome markdown

layout: post
title: Markdown Style Guide
---
@toddwseattle
toddwseattle / launch.json
Created March 12, 2020 05:09
example nx launch.json for use with vscode (place in .vscode)
{
// 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": "edge",
"request": "launch",
"name": "Launch Edge on localhost://4200 pe app",