Skip to content

Instantly share code, notes, and snippets.

View jsancho's full-sized avatar

Jaume Sancho jsancho

View GitHub Profile
@jsancho
jsancho / DotEnv.cs
Last active November 30, 2021 12:20
using System;
using System.IO;
namespace YourNamespace
{
// adapted from https://dusted.codes/dotenv-in-dotnet
public static class DotEnv
{
public static void Load()
{

Keybase proof

I hereby claim:

  • I am jsancho on github.
  • I am jaumesancho (https://keybase.io/jaumesancho) on keybase.
  • I have a public key ASC3FMrxAIw0ZSy1oF-9PJFcodWzyFZGt_slJMpwqjNpiAo

To claim this, I am signing this object:

{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"Test_Swagger_Routing": {
"inputs": {
"functionApp": {
"id": "/subscriptions/HIDDEN_FROM_PUBLIC_GIST/resourceGroups/HIDDEN_FROM_PUBLIC_GIST/providers/Microsoft.Web/sites/functionapptest"
},
"method": "get",
[FunctionName("SwaggeredFunction")]
public static async Task<HttpResponseMessage> Run(
[HttpTrigger(AuthorizationLevel.Function, "get", "post",
Route = "SwaggeredFunction/{name}")]
HttpRequestMessage req,
string name,
TraceWriter log)
{
log.Info("C# HTTP trigger function processed a request.");
@jsancho
jsancho / broadcast.js
Last active April 17, 2018 21:37
Example of how to post a message to a fanout.io channel with an AWS lambda
exports.handler = (event, context, callback) => {
console.log('sending message to subscribers');
console.log(JSON.stringify(event));
console.log('using GRIP_URL');
console.log(process.env.GRIP_URL);
const grip = require('grip');
const faas_grip = require('faas-grip');