A simple App using Vue.js & Firebase with Auth.
See the DEMO.
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) { |
git clone https://github.com/vfarcic/go-demo.git | |
cd go-demo | |
docker-machine create -d virtualbox go-demo | |
docker-machine env go-demo | |
eval $(docker-machine env go-demo) |
#!/bin/bash | |
# vars | |
[ -z "$NUM_WORKERS" ] && NUM_WORKERS=3 | |
# init swarm (need for service command); if not created | |
docker node ls 2> /dev/null | grep "Leader" | |
if [ $? -ne 0 ]; then | |
docker swarm init > /dev/null 2>&1 | |
fi |
Permalink: git.io/vps
Provider | Type | RAM | Cores | Storage | Transfer | Network | Price |
---|
# -------------------------------------------------------------- | |
# script to create a new Docker Swarm from scratch on VirtualBox | |
# -------------------------------------------------------------- | |
#!/usr/bin/bash | |
NUM_NODES=5 | |
LEADER_NODE=node-1 | |
# clean up | |
for NODE in $(seq 1 $NUM_NODES); do |