Skip to content

Instantly share code, notes, and snippets.

View rbren's full-sized avatar
🐢
I may be slow to respond.

Robert Brennan rbren

🐢
I may be slow to respond.
  • Fairwinds
  • Boston, Massachusetts
View GitHub Profile
var tick = "`"
var code =
`
console.log('var tick = "' + tick + '"');
console.log('var code = ');
console.log(tick);
console.log(code.trim());
console.log(tick);
console.log(code.trim());
`
This file has been truncated, but you can view the full file.
{
"kind": "NodeList",
"apiVersion": "v1",
"metadata": {
"selfLink": "/api/v1/nodes",
"resourceVersion": "9103"
},
"items": [
{
"metadata": {
@rbren
rbren / index.html
Last active October 26, 2018 20:09
OneDB simple example
<html>
<head>
<script src="https://unpkg.com/onedb-client/dist/onedb-client.min.js"></script>
<script>
var onedb = new OneDBClient({
hosts: {
primary: {location: 'https://one-db.datafire.io'},
}
});
</script>
Verifying my Blockstack ID is secured with the address 1KmvT1LfgXLPcRSbhFnJzXcwtAwVc7QK5S https://explorer.blockstack.org/address/1KmvT1LfgXLPcRSbhFnJzXcwtAwVc7QK5S
<form method="post" action="https://contact-us.prod.with-datafire.io/contact">
<label>Your e-mail</label>
<input type="text" name="from">
<label>Message</label>
<textarea name="message"></textarea>
</form>
service: serverless-contact
provider:
name: aws
runtime: nodejs6.10
functions:
contact:
handler: handler.contact
events:
var CONTACT_ADDRESS = '[email protected]';
var querystring = require('querystring');
var mailer = require('nodemailer').createTransport({
service: 'Gmail',
auth: {
user: process.env.GMAIL_ADDRESS,
pass: process.env.GMAIL_PASSWORD,
}
});
let app = require('express')();
app.use(require('body-parser').urlencoded());
app.post('/contact', function(req, res) {
console.log('new message', req.body);
});
app.listen(3000);
<form method="post" action="http://api.company.com/contact">
<label>Your e-mail</label>
<input type="text" name="from">
<label>Subject</label>
<input type="text" name="subject">
<label>Message</label>
<textarea name="body"></textarea>
</form>
let app = require('express')();
app.use(require('body-parser').urlencoded());
const CONTACT_ADDRESS = '[email protected]';
var mailer = require('nodemailer').createTransport({
service: 'Gmail',
auth: {
user: process.env.GMAIL_ADDRESS,
pass: process.env.GMAIL_PASSWORD,