A simple App using Vue.js & Firebase with Auth.
See the DEMO.
| const MY_DOMAIN = "agodrich.com" | |
| const START_PAGE = "https://www.notion.so/gatsby-starter-notion-2c5e3d685aa341088d4cd8daca52fcc2" | |
| const DISQUS_SHORTNAME = "agodrich" | |
| addEventListener('fetch', event => { | |
| event.respondWith(fetchAndApply(event.request)) | |
| }) | |
| const corsHeaders = { | |
| "Access-Control-Allow-Origin": "*", |
| const { setContext } = require('apollo-link-context'); | |
| const { HttpLink } = require('apollo-link-http'); | |
| const { introspectSchema, makeRemoteExecutableSchema } = require('graphql-tools'); | |
| const fetch = require('node-fetch'); | |
| module.exports = function(api) { | |
| api.createSchema(async function(graphql) { | |
| const http = new HttpLink({ | |
| uri: 'http://example.com/api', | |
| fetch |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Instagram Gallery</title> | |
| <script src="https://unpkg.com/vue@2.5.16/dist/vue.min.js"></script> | |
| <script src="https://unpkg.com/axios/dist/axios.min.js"></script> | |
| <style type="text/css"> | |
| :root{ | |
| --color: #95e9ef; | |
| --background: #1f1f1f; |
| // Open form and submit enquire for `rego` | |
| function getInfo(rego) { | |
| horseman | |
| .userAgent('Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0') | |
| .open(url) | |
| .type('#registration-number-ctrl input[type=text]', rego) | |
| .click('.btn-holder input') | |
| .waitForSelector('.ctrl-holder.ctrl-readonly') | |
| .html() | |
| .then(function(body) { |
| const functions = require('firebase-functions') | |
| const admin = require('firebase-admin') | |
| admin.initializeApp(functions.config().firebase); | |
| const stripe = require('stripe')(functions.config().stripe.testkey) | |
| exports.stripeCharge = functions.database |
| var functions = require('firebase-functions'); | |
| const sendgrid = require('sendgrid') | |
| const client = sendgrid("YOUR_SG_API_KEY") | |
| function parseBody(body) { | |
| var helper = sendgrid.mail; | |
| var fromEmail = new helper.Email(body.from); | |
| var toEmail = new helper.Email(body.to); | |
| var subject = body.subject; |
| 'use strict'; | |
| const fs = require('fs'); | |
| const ndjson = require('ndjson'); | |
| const request = require('request'); | |
| fs.createReadStream('reddit-comments.json') // Newline delimited JSON file | |
| .pipe(ndjson.parse()) | |
| .on('data', function(obj) { |
| //require the google-cloud npm package | |
| //setup the API keyfile, so your local environment can | |
| //talk to the Google Cloud Platform | |
| const gcloud = require('google-cloud')({ | |
| projectId: process.env.GCLOUD_PROJECT, | |
| keyFilename: process.env.GCLOUD_KEY_FILE | |
| }); | |
| //We will make use of the bigquery() API | |
| const bq = gcloud.bigquery(); |
A simple App using Vue.js & Firebase with Auth.
See the DEMO.
| let axios = require('axios'); // HTTP client | |
| let cheerio = require('cheerio'); // HTML parsing package | |
| let jsonframe = require('jsonframe-cheerio'); // a cheerio plugin I designed | |
| let fs = require('fs'); // is included in node.js - you don't need to install it | |
| axios.get('https://www.producthunt.com') | |
| .then((response) => { | |
| if(response.status === 200) { |