This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Net; | |
using StackExchange.Redis; | |
public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log) | |
{ | |
log.Info("C# HTTP trigger function processed a request."); | |
// **** REDIS CODE STARTS HERE | |
var connString = System.Configuration.ConfigurationManager.ConnectionStrings["mycats"].ConnectionString; | |
var redis = ConnectionMultiplexer.Connect(connString); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Using promise | |
const listRef = storage | |
.ref('screenshots/abc123.png') | |
.getDownloadURL() | |
.then((response) => { | |
// Found it. Do whatever | |
}) | |
.catch((err) => { | |
// Didn't exist... or some other error | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"wolves": [ | |
{ "images": [ | |
"https://wolftracker9eee.blob.core.windows.net/wolfpictures-mock/big-wolf1.png", | |
"https://wolftracker9eee.blob.core.windows.net/wolfpictures-mock/wolf1.png" | |
]}, | |
{ "images": [ | |
"https://wolftracker9eee.blob.core.windows.net/wolfpictures-mock/big-wolf2.png", | |
"https://wolftracker9eee.blob.core.windows.net/wolfpictures-mock/wolf2.png" | |
]}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<div class="question"> | |
Q1: What is fun? | |
</div> | |
<div> | |
<input type="radio" id="a0" name="question0"> | |
<label for="a0">Going for a walk</label> | |
</div> | |
<div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /usr/src | |
wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz | |
sudo tar xzf Python-3.6.0.tgz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const functions = require('firebase-functions') | |
const admin = require('firebase-admin') | |
admin.initializeApp(functions.config().firebase) | |
const SENDGRID_API_KEY = functions.config().sendgrid.key | |
const sendGridEmail = require('@sendgrid/mail') | |
sendGridEmail.setApiKey(SENDGRID_API_KEY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"type": "chrome", | |
"request": "attach", | |
"name": "attach to Chrome", | |
"port": 9222, | |
"webRoot": "${workspaceFolder}", | |
"sourceMapPathOverrides": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
** Build configuration | |
*/ | |
build: { | |
/* | |
** You can extend webpack config here | |
*/ | |
extend(config, ctx) { | |
if (ctx.isDev) { | |
config.devtool = ctx.isClient ? 'source-map' : 'inline-source-map' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addEventListener('fetch', event => { | |
event.respondWith(handleRequest(event)) | |
}) | |
/** | |
* Entry point of the worker | |
*/ | |
async function handleRequest(event) { | |
// Generate the CORS headers I'll have to return with requests | |
const corsHeaders = setCorsHeaders(new Headers()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RegisterViewModel | |
{ | |
[Required] | |
[Display(Name = "First Name")] | |
[StringLength(100, ErrorMessage = "{0} must be at least {2} characters long.", MinimumLength = 2)] | |
public string FirstName { get; set; } | |
[Required] | |
[Display(Name = "Last Name")] | |
[StringLength(100, ErrorMessage = "{0} must be at least {2} characters long.", MinimumLength = 2)] |