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 os | |
| import Crypto | |
| from hashlib import md5 | |
| from Crypto.Cipher import AES | |
| from Crypto import Random | |
| import hexdump | |
| from chardet import detect | |
| source_directory = '' | |
| target_directory = '' |
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
| from googleapiclient.discovery import build | |
| from googleapiclient.http import MediaFileUpload | |
| media = MediaFileUpload(filename, mimetype='video/MP2T', resumable=True) # change mimetype to appropriate mimetype | |
| google_drive_request = drive.files().create(media_body=media) | |
| google_drive_response = None | |
| while google_drive_response is None: | |
| status, response = google_drive_request.next_chunk() | |
| if status: | |
| print("Uploaded %d%%." % int(status.progress() * 100)) |
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
| { | |
| "firestore": { | |
| "rules": "firestore.rules", | |
| "indexes": "firestore.indexes.json" | |
| }, | |
| "hosting": { | |
| "public": "build", | |
| "ignore": ["firebase.json", "**/.*", "**/node_modules/**"] | |
| } | |
| } |
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
| if (window.location.hostname === 'localhost') { | |
| console.log("testing locally -- hitting local functions and firestore emulators"); | |
| firebase.functions().useFunctionsEmulator('http://localhost:5001'); | |
| firebase.firestore().settings({ | |
| host: 'localhost:8080', | |
| ssl: false | |
| }); | |
| } |
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 firebase = require('firebase/app'); | |
| require('firebase/auth'); | |
| require('firebase/functions'); | |
| require('firebase/firestore'); | |
| const firebaseConfig = { | |
| apiKey: '', | |
| authDomain: '', | |
| databaseURL: '', | |
| projectId: '', |
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
| use GuzzleHttp\Psr7\Request; | |
| use GuzzleHttp\Client; | |
| private function purgeImgixUrl($url) { | |
| $client = new Client(); | |
| try { | |
| $response = $client->post('https://api.imgix.com/v2/image/purger', [ | |
| 'headers' => [ | |
| 'Content-Type' => 'application/json', | |
| 'Authorization' => 'Basic ' . base64_encode($this->ImgixApiToken . ':') |