This file contains hidden or 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 { Component, OnInit } from '@angular/core'; | |
import { DocumentData, QuerySnapshot } from '@firebase/firestore'; | |
import { FirebaseService } from '../firebase.service'; | |
@Component({ | |
selector: 'app-firebase-crud', | |
templateUrl: './firebase-crud.component.html', | |
styleUrls: ['./firebase-crud.component.css'] | |
}) | |
export class FirebaseCrudComponent implements OnInit { |
This file contains hidden or 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 { initializeApp } from 'firebase/app'; | |
import { Firestore, getFirestore, collection, addDoc, getDocs, deleteDoc, doc, updateDoc, DocumentData, CollectionReference, onSnapshot, QuerySnapshot } from 'firebase/firestore' | |
import { Subject } from 'rxjs'; | |
import { environment } from '../environments/environment'; | |
@Injectable({ | |
providedIn: 'root' | |
}) |
This file contains hidden or 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
export const environment = { | |
production: false, | |
firebaseConfig: { | |
apiKey: "-----", | |
authDomain: "-----", | |
projectId: "----", | |
storageBucket: "----", | |
messagingSenderId: "-----", | |
appId: "-----" | |
} |
This file contains hidden or 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 { Component, OnInit } from '@angular/core'; | |
@Component({ | |
selector: 'app-firebase-crud', | |
templateUrl: './firebase-crud.component.html', | |
styleUrls: ['./firebase-crud.component.css'] | |
}) | |
export class FirebaseCrudComponent implements OnInit { | |
studentDetails = { |
This file contains hidden or 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
<h1>Add Student</h1> | |
<form class="add"> | |
<label for="name">Name</label> | |
<input type="text" name="name" required [(ngModel)]="studentDetails.name" /> | |
<label for="age">Age</label> | |
<input type="text" name="age" required [(ngModel)]="studentDetails.age" /> | |
<button type="button" (click)="add()">Add</button> | |
</form> |
This file contains hidden or 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
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Document</title> | |
</head> | |
<body> | |
<img src="<%= name %>" /> | |
</body> | |
</html> |
This file contains hidden or 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
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Document</title> | |
</head> | |
<body> | |
<input type="file" id="file-input" accept="image/*" /> | |
<script> | |
const inputFile = document.getElementById("file-input"); |
This file contains hidden or 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 sql = require('mysql'); | |
const app = express(); | |
app.use(express.json({ limit: "50mb" })); | |
app.use(express.urlencoded({ extended: true })); | |
app.set("view engine", "ejs"); | |
const config = { |
This file contains hidden or 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
Create Table file(id Int AUTO_INCREMENT Not Null Primary Key, file_name Varchar(30), file_data LONGBLOB Not Null, created_by Varchar(20) Not Null, created_on Datetime Not Null); |
This file contains hidden or 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
//AES Encryption | |
public static string EncryptString(string plainText, string keyToUse) { | |
byte[] iv = new byte[16]; | |
byte[] array; | |
using(Aes aes = Aes.Create()) { | |
aes.Key = Encoding.UTF8.GetBytes(Get128BitString(keyToUse)); | |
aes.IV = iv; | |
ICryptoTransform encryptor = aes.CreateEncryptor(aes.Key, aes.IV); |
NewerOlder