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
<div class="card"> | |
<div class="card-body"> | |
<app-pagination #pagination [collectionSize]="tableContent.length" [pageSize]="10" [firstLastButtons]="true" [maxSize]="2"> | |
</app-pagination> | |
<table class="table table-sm"> | |
<tbody> | |
<tr | |
*ngFor="let t of tableContent | slice : (pagination.currentPage - 1) * pagination.pageSize : pagination.currentPage * pagination.pageSize"> | |
<td>{{ t.name }}</td> |
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
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.177.0/containers/javascript-node/.devcontainer/base.Dockerfile | |
# [Choice] Node.js version: 16, 14, 12 | |
ARG VARIANT="16-buster" | |
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:0-${VARIANT} | |
# [Optional] Uncomment this section to install additional OS packages. | |
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ | |
# && apt-get -y install --no-install-recommends <your-package-list-here> |
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 express = require('express') | |
const multer = require('multer') | |
const app = express() | |
const upload = multer() | |
app.post('/api/parse', upload.any(), async (req, res) => { | |
const body = req.body |
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 jwt = require('jsonwebtoken'); | |
const authMiddleware = (req, res, next) => { | |
const authHeader = req.get('Authorization') | |
if (!authHeader) { | |
req.error = "No authentication header found." | |
req.isAuth = false | |
return next() | |
} |
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
DECLARE @SQL varchar(max) | |
SET @SQL = (SELECT ' TRUNCATE TABLE [' + TABLE_SCHEMA +'].['+ TABLE_NAME + '];' | |
FROM INFORMATION_SCHEMA.TABLES | |
ORDER BY TABLE_SCHEMA DESC | |
FOR XML PATH('')) | |
-- Print Statement | |
-- SELECT @SQL |
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
function createDownloadLink(str, fileName, contentType) { | |
var blob = new Blob([str], { | |
type: "application/json;charset=utf-8" | |
}); | |
var blobUrl = URL.createObjectURL(blob); | |
var a = document.createElement("a"); | |
a.href = blobUrl; | |
a.setAttribute("download", fileName + ".json"); | |
document.body.appendChild(a); | |
a.click(); |
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 asc = (a, b) => a - b | |
const desc = (a, b) => b - a | |
array = array.map(a => new Date(a.dob)).sort(desc)//.reverse() // Date | |
array = array.map(a => a.pocketMoney).sort(asc)//.reverse() // Number | |
console.log(array) |
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
git reset --soft HEAD^ | |
git push origin [+branchName(master)] --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
public void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddAuthorization(o => | |
{ | |
o.AddPolicy("GroupOfUsers", policy => policy.RequireClaim("groups", "3916f0cf-d728-48c4-b18b-e3a29e852c12", "5169a59e-a4c6-44c2-b6ec-dff6910fb2f4")); | |
}); | |
} |
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
public void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddAuthentication(AzureADDefaults.BearerAuthenticationScheme) | |
.AddAzureADBearer(options => Configuration.Bind("AzureAd", options)); | |
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); | |
services.AddCors(options => | |
{ | |
options.AddPolicy("AllowAllOrigins", builder => |
NewerOlder