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
library(foreign) | |
# SAV file? | |
write.table(read.spss("spss_data.sav"), file="from_sav_data.csv", quote = FALSE, sep = ",") | |
# DTA file? | |
write.table(read.dta("spss_data.dta"), file="from_dta_data.csv", quote = FALSE, sep = ",") |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<!-- see https://leightley.com/gist-html5-video-player-with-javascript/ --> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> |
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 | |
}); | |
}); |
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
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
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 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
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
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
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 |
OlderNewer