Skip to content

Instantly share code, notes, and snippets.

View Startup.cs
[assembly: FunctionsStartup(typeof(Startup))]
namespace MyFunctionsProject
public class Startup : FunctionsStartup
public override void Configure(IFunctionsHostBuilder builder)
// this will bind to the "Values" section of the configuration
aranm / ApplicationSettings.cs
Last active Aug 6, 2019
Application Settings and Connection Strings POCO
View ApplicationSettings.cs
public class ApplicationSettings
public string AzureWebJobsStorage { get; set; }
public string SuperApiKey { get; set; }
public class ConnectionStrings
public string SqlConnectionString { get; set; }
View local.settings.json
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"ConnectionStrings": {
"SqlConnectionString": "MyConnectionString"
View IApplicationSettings.cs
public interface IApplicationSettings
string Get(string key);
string Get(string key, string defaultValue);
aranm / functions.cs
Last active Aug 6, 2019
Azure Functions with DI'd Application Settings
View functions.cs
public class MyFunctions
private readonly IOptions<ApplicationSettings> _applicationSettingsOptions;
private readonly IOptions<ConnectionStrings> _connectionStringsOptions;
public MyFunctions(IOptions<ApplicationSettings> applicationSettingsOptions, IOptions<ConnectionStrings> connectionStringsOptions)
// the "Values" section of the configuration file
_applicationSettingsOptions = applicationSettingsOptions;
View Install PHP 5.3 on Ubuntu 14.04(trusty)
#Add the Ubuntu 12.04(precise) repositories
cat <<EOF >> /etc/apt/sources.list
deb precise main restricted universe
deb precise-updates main restricted universe
deb precise-security main restricted universe multiverse
# Update the repos
apt-get update
View SocialNetworkFeed
= The Feed is King (or Queen)
When creating a social network type application the feed is king, the most common query that will be run against your service will be a request to get the feed. There are of course many ways to model the feed and a couple of components that are required.
To do a very simple feed one might structure the data as follows:
Users follow other users
View GraphGist-syntax.adoc

How to create a GraphGist

You create a GraphGist by creating a GitHub Gist in AsciiDoc and enter the URL to it in the form on this page. Alternatively, you can put an AsciiDoc document in Dropbox and enter the public URL in the form.

This GraphGist shows the basics of using AsciiDoc syntax and a few additions for GraphGists. The additions are entered as comments on their own line. They are: //console for a query console; //hide, //setup and //output to configure a query; //graph and //table to visualize queries and show a result table.

Click on the Page Source button in the menu to see the source for this GraphGist.

View node.js event emitter example
var events = require('events');
function callSomething(){
var eventEmitter = new events.EventEmitter();
console.log("Method called");
eventEmitter.emit("data", "Hello immediately (you will never see this message)");