Skip to content

Instantly share code, notes, and snippets.

View dontpaniclabsgists's full-sized avatar

Don't Panic Labs dontpaniclabsgists

View GitHub Profile
<p>
Bill Udell is an engineer with style. I, Chad Michel, decided to make it easier for the rest of us to upgrade our wardrobe to a more Bill-approved version. This will help us get rid of the StrongBad t-shirt and get into something nicer.
</p>
@NgModule({
declarations: [
AppComponent,
AboutComponent,
HomeComponent
],
imports: [
BrowserModule,
RouterModule.forRoot(
appRoutes,
const appRoutes: Routes = [
{
path: 'about',
component: AboutComponent
},
{
path: '**',
component: HomeComponent
}
];
using System.Net;
 
public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log)
{
    log.Info("C# HTTP trigger function processed a request.");
 
    // parse query parameter
    string name = req.GetQueryNameValuePairs()
        .FirstOrDefault(q => string.Compare(q.Key, "name", true) == 0)
        .Value;
@dontpaniclabsgists
dontpaniclabsgists / azure_functions_1_1.html
Last active August 25, 2017 15:03
azure_functions_1_1
<html>
<body>
<div>Hello</div>
</body>
</html>
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CosmosTest
{
class Program
using Microsoft.Azure.Documents.Client;
using Microsoft.Azure.Documents.Linq;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CosmosTest
public async Task<Note[]> AllSql()
{
using (var client = new DocumentClient(new Uri(_endpoint), _key))
{
var link = UriFactory.CreateDocumentCollectionUri(_databaseId, CollectionId);
var query = client.CreateDocumentQuery<Note>(link,
"select * from notes",
new FeedOptions()
{
public async Task<Note[]> All()
{
using (var client = new DocumentClient(new Uri(_endpoint), _key))
{
var link = UriFactory.CreateDocumentCollectionUri(_databaseId, CollectionId);
var query = client.CreateDocumentQuery<Note>(
link,
new FeedOptions()
{
public int CountSql()
{
using (var client = new DocumentClient(new Uri(_endpoint), _key))
{
var link = UriFactory.CreateDocumentCollectionUri(_databaseId, CollectionId);
var count = client.CreateDocumentQuery<int>(
link,
"select value count(1) from notes",
new FeedOptions()