Skip to content

Instantly share code, notes, and snippets.

View utkarshbhatt12's full-sized avatar
🎯
Focusing

Utkarsh Bhatt utkarshbhatt12

🎯
Focusing
View GitHub Profile
/(root)/
index.html <-- standard index file
/js <-- all js files here
app.js
/firebase/ <-- firebase js code here
__init.js
crud.js
/css/ <-- all styles here
style.css
/(root)/ <-- collection
/<auto-id>/ <-- document with unique autogenerated ID
title: string!
body: string!
timestamp: timestamp!
updateTimestamp: timestamp
/<auto-id>/ <-- another document with autogenerated ID
title: string!
body: string!
timestamp: timestamp
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
// default is false to disallow any read, and write operation
allow read, write: if true; // true allows unrestricted access
}
}
}
// url: https://us-central1-contactform-1b262.cloudfunctions.net/currentFirebaseTime
const functions = require('firebase-functions');
exports.currentFirebaseTime = functions.https.onRequest((req, res) => {
let d = new Date();
res.send(d);
});
import hashlib
import json
EPOCH = "01/01/1970"
class Block:
def __init__(self, index, time_stamp, data, prev_hash=''):
self.index = index
self.prevHash = prev_hash
{
'users': [{
'id': 'cde9e392-8cd2-404c-8800-3c9286c812f8',
'name': 'Ernest K. Gonzalez'
}, {
'id': '15c3d4f9-7abd-4aec-8a44-e16631bdec53',
'name': 'Robert B Carlson'
}],
'employees': [
{
data = json.loads(user_info)
{
"added_words":
[
"js",
"jquery",
"Tooltips",
"href",
"http",
"https",
"github",
import json
user_info = ''' {
"users": [
{
"id": "cde9e392-8cd2-404c-8800-3c9286c812f8",
"name": "Ernest K. Gonzalez"
},
{
"id": "15c3d4f9-7abd-4aec-8a44-e16631bdec53",