Skip to content

Instantly share code, notes, and snippets.

View birchb's full-sized avatar

birchb

View GitHub Profile
let primes = [ ]
const findNextPrime = (primeArray) => {
let foundPrime = false
for(np = 2; !foundPrime; np++) {
let isPrime = true
while(isPrime){
for(p = 0; p < primeArray.length; p++) {
if (np % primes[p] == 0) {
isPrime = false
break
const functions = require('firebase-functions');
const gcs = require('@google-cloud/storage')({keyFilename: 'service-key.json'});
const spawn = require('child-process-promise').spawn;
const path = require('path');
const os = require('os');
const fs = require('fs');
exports.createCard = functions.firestore
.document('work_cards/{cardID}')
.onCreate((snap, context) => {