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
from google.cloud import bigquery | |
from google.oauth2 import service_account | |
import pandas as pd | |
# generate a service account container based on service account key | |
credentials = service_account.Credentials.from_service_account_file('ServiceAccountKey.json') | |
# define the project ID | |
project_id = '' |
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 pyrebase | |
import os | |
# define firebase config for the project being queried | |
firebaseConfig = { | |
"apiKey": "", | |
"authDomain": "", | |
"projectId": "", | |
"storageBucket": "", | |
"messagingSenderId": "", |
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 pandas as pd | |
import firebase_admin | |
from firebase_admin import credentials, firestore | |
# set the root folder path | |
base_url = '<BASE URL HERE>' | |
# used for paging when downloading data e.g. only 1000 documents downloaded per call | |
limit = 1000 |
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 http = require('http'); | |
const https = require('https'); | |
const app = express(); | |
const router = express.Router(); | |
const cors = require('cors') | |
const admin = require('firebase-admin'); | |
const bodyParser = require('body-parser'); |
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
server { | |
listen 80; | |
listen [::]:80; | |
server_name kcmhr.org www.kcmhr.org; | |
return 301 https://$host$request_uri; | |
} | |
server { |
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 core libraries | |
import tweepy # Obtain Tweets | |
import pandas as pd # Store and manage Tweets | |
import numpy as np # Number processing | |
import re | |
from credentials import * | |
from textblob import TextBlob | |
# Setup plotting and visualisation |
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 { ModuleWithProviders } from '@angular/core'; | |
import { Routes, RouterModule } from '@angular/router'; | |
import { AppComponent } from './app.component'; | |
import { AuthGuard } from "./services/authGuard.service"; | |
import { LoginComponent } from "./views/login/login.component"; | |
import { SignupComponent } from './views/signup/signup.component'; | |
import { DashboardComponent } from "./views/dashboard/dashboard.component"; |
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 { CanActivate, ActivatedRouteSnapshot, RouterStateSnapshot, Router } from '@angular/router'; | |
import { Observable } from 'rxjs/Observable'; | |
import { AngularFireAuth } from 'angularfire2/auth'; | |
import 'rxjs/add/operator/do'; | |
import 'rxjs/add/operator/map'; | |
import 'rxjs/add/operator/take'; | |
@Injectable() |
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 functions = require('firebase-functions'); | |
const admin = require('firebase-admin'); | |
admin.initializeApp(functions.config().firebase); | |
exports.deleteProfile = functions.auth.user().onDelete( event => { | |
return admin.database().ref(`/user/${event.data.uid}`).remove(); | |
}); |
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 functions = require('firebase-functions'); | |
const admin = require('firebase-admin'); | |
admin.initializeApp(functions.config().firebase); | |
exports.createProfile = functions.auth.user().onCreate( event => { | |
return admin.database().ref(`/user/${event.data.uid}`).set({ | |
email: event.data.email, | |
emailUpdates: true | |
}); | |
}); |
NewerOlder