This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@angular/core'; | |
import { UserManager, User } from 'oidc-client'; | |
import { Observable, from } from 'rxjs'; | |
@Injectable({ | |
providedin: 'root' | |
}) | |
export class AuthService { | |
private userManager: UserManager; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM Windows CMD | |
REM List all the node_modules folders | |
FOR /d /r . %d in (node_modules) DO @IF EXIST "%d" echo "%d" | |
REM Remove all the node modules folders | |
FOR /d /r . %d in (node_modules) DO @IF EXIST "%d" del /q /s "%d" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Mac/Linux Terminal | |
# List all node_modules folders in a directory | |
find . -name "node_modules" -type d -prune -print | xargs du -chs | |
# Delete all node_modules folders in a directory | |
find . -name 'node_modules' -type d -prune -print -exec rm -rf '{}' \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Windows Powershell | |
# 1. cd into the root directory you want to start from | |
# 2. run the follwing command | |
Get-ChildItem -Path "." -Include "node_modules" -Recurse -Directory | Remove-Item -Recurse -Force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Based on spec: https://tools.ietf.org/html/rfc7636#section-4 | |
* Uses: https://cdnjs.cloudflare.com/ajax/libs/crypto-js/4.0.0/crypto-js.min.js | |
*/ | |
/** | |
* | |
* Static values | |
* | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// curtesy of this post https://levelup.gitconnected.com/polling-in-javascript-ab2d6378705a | |
const poll = async ({ fn, validate, interval, maxAttempts }) => { | |
let attempts = 0; | |
const executePoll = async (resolve, reject) => { | |
const result = await fn(); | |
attempts++; | |
const validationResult = await validate(result); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const http = require('http'); | |
const querystring = require('querystring'); | |
const host = 'localhost'; | |
const port = 1235; | |
const contact = { firstName: 'Joe', lastName: 'Blow', email: '[email protected]' }; | |
const server = http.createServer(function (req, res) { | |
res.setHeader('Access-Control-Allow-Origin', '*'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import platform | |
import yfinance as yf | |
import time | |
import sys | |
import warnings | |
def clear_terminal(): | |
# Clear terminal screen based on the operating system | |
if platform.system() == 'Windows': |