Skip to content

Instantly share code, notes, and snippets.

View burkeholland's full-sized avatar

Burke Holland burkeholland

  • Microsoft
  • Franklin, TN
View GitHub Profile
const express = require("express");
const app = express();
const port = process.env.PORT || 3000;
// viewed at http://localhost:3000
app.get("/", function(req, res) {
res.send("Again I Go Unnoticed");
});
app.listen(port, () => console.log(`Example app listening on port ${port}!`));

Sometimes I wonder if I know much of anything at all. Just a few weeks ago I was talking to a friend who mentioned off-hand, "you would never run an application directly against Node in production". I nodded vigerously to signal that I also would never ever run against Node in production because everyone knows that. But I didn't know that! Why didn't I know that?!?!

If I was to draw a Venn Diagram of what I know vs what I feel like everyone else knows, it would look like this...

What I know VENN

There is a better diagram created by Alicia Liu that kind of changed my life. It says that it's more like this...

Alicia's Venn Diagram

<script src="https://code.jquery.com/jquery-3.1.1.min.js')"></script>
<script type="text/javascript')">
var url = "https://functionsendemails.azurewebsites.net/api/StoreEmail?code=hKngrr6sq35GJ8cb6al4K6oP0cRphKNDMXpLrCtoNCJzM0ZDwJNkJQ==";
$("form").on('submit', function (event) {
event.preventDefault();
var data = $(this).serialize();
$("#target :input").prop("disabled", true);
var reg = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\
Hey folks!
Give me just 2 minutes of your time for a quick request.
I’d like to encourage everyone here who has an ongoing product meeting/relationship to periodically send out notes or updates from your meetings to the entire CDA group. @Sarah Drasner pioneered this model with the Functions team meeting, and it has proven to be highly beneficial in several ways…
1. The rest of the CDA’s can easily see the most important items about all of our products.
2. Your relationships become highly visible.
a. The engineering/product teams see that they are visible in the CDA org and they all want that
b. It will help us track impact as we look back through all of the great things we’ve done with our feedback and relationships.

Deploying Express to Azure

  1. Start with simple Express app
  2. Create site in Azure from VS Code extension
    1. Explain Resource Groups and Service Plans
    2. Show how VS Code configures project to do npm install on deploy
  3. Push site via zip deploy
  4. Push site via local git
  5. Push site via github
  6. Show common errors
{
"items": [
{
"id": 2051,
"name": "Extension Cord",
"price": 15,
"productType": "Electrical",
"supplierName": "Northwind",
"shortDescription": "Outlet not where you need it? Extend your power to the right place at the right time",
},
const apiBaseUrl = "https://i-enjoy-lamp.azurewebsites.net";
mounted() {
let connection = new signalR.HubConnectionBuilder()
.withUrl(`${apiBaseUrl}/api`).build();
connection.on(
"colorChanged",
(hex) => {
this.colors = { hex: `#${hex}` };
@burkeholland
burkeholland / App.vue
Created January 16, 2019 21:21
Wiring up to listen to changes from SignalR hub
<template>
<div class="main animate" :style="{ 'background-color': colors.hex }" ref="target">
<div class="color">
<div class="title">
<h1 class="animate" :style="{ 'color': inverse }">I Enjoy Lamp</h1>
<h3 class="animate" :style="{ 'color': inverse }">
Change the color of
<a href="https://twitter.com/burkeholland">Burke's</a> LIFX connected lightbulb
</h3>
<p class="animate" :style="{ 'color': inverse }" id="livestreamLink">
@burkeholland
burkeholland / function.json
Created January 14, 2019 23:26
"negotiate" function.json
{
"disabled": false,
"bindings": [
{
"authLevel": "anonymous",
"type": "httpTrigger",
"direction": "in",
"name": "req",
"methods": [
"get",
@burkeholland
burkeholland / index.js
Created January 14, 2019 23:24
"negotiate" Function
module.exports = async function (context, req, connectionInfo) {
context.res = { body: connectionInfo };
};