This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.
Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).
export const ws = webSocket<WebsocketMessage>(`wss://${location.hostname}:${location.protocol === 'https:' ? 443 : 80}/ws/`); | |
export const wsObserver = ws | |
.pipe( | |
retryWhen(errors => | |
errors.pipe( | |
delay(1000) | |
) | |
) | |
); |
.......some config..... | |
alertmanager: | |
## Deploy alertmanager | |
## | |
enabled: true | |
## Service account for Alertmanager to use. | |
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ | |
## |
import { Injectable } from '@angular/core'; | |
import { Observable, Observer, Subscription } from 'rxjs'; | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class AsyncApiCallHelperService { |
This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.
Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).
// NGRX Complete Tutorial Without Pain (Angular6 / RxJS6) | |
// https://medium.com/@andrew.kao/ngrx-complete-tutorial-without-pain-angular6-rxjs6-5511b8cb8dac | |
import { Injectable } from '@angular/core'; | |
import { CanActivate } from '@angular/router'; | |
import { Store, select } from '@ngrx/store'; | |
import { Observable } from 'rxjs'; | |
import { map, take } from 'rxjs/operators'; | |
import * as Auth from '(auth actions)'; | |
import * as fromTeam from '(team main reducer)'; |
const path = require('path'); | |
function trace(s) { | |
const orig = Error.prepareStackTrace; | |
Error.prepareStackTrace = (_, stack) => stack; | |
const err = new Error(); | |
Error.captureStackTrace(err, arguments.callee); | |
Error.prepareStackTrace = orig; | |
const callee = err.stack[0]; | |
process.stdout.write(`${path.relative(process.cwd(), callee.getFileName())}:${callee.getLineNumber()}: ${s}\n`); |
#!/bin/bash | |
# This script should have been runned by user (non root) | |
# In case of errors like cannot open display: | |
# 1. Change DISPLAY=:0 for actual working display | |
# 2. Check (and change) permissions of files and dirs in user home dir | |
# specialy when you run this script as root by accident | |
# sometimes dirs like .dconf may be owned as root. | |
# As result vino server will not run under user privileges |
Create React App does not provide watching build mode oficially (#1070).
This script provides watching build mode for an external tool such as Chrome Extensions or Firebase app.
Create a React app.
Put the script into scripts/watch.js
.
// MIT Licensed | |
// Author: jwilson8767 | |
/** | |
* Waits for an element satisfying selector to exist, then resolves promise with the element. | |
* Useful for resolving race conditions. | |
* | |
* @param selector | |
* @returns {Promise} | |
*/ |
package main | |
import ( | |
"bufio" | |
"fmt" | |
"io" | |
"os" | |
"os/exec" | |
"strings" | |
) |