Skip to content

Instantly share code, notes, and snippets.

View DotNetNerd's full-sized avatar

Christian Holm Diget DotNetNerd

View GitHub Profile
@DotNetNerd
DotNetNerd / ShadowDOM
Created May 22, 2013 08:55
Use of shadow DOM
<html>
<body>
<template id="nameTagTemplate">
<style>
.outer {
border: 2px solid pink;
border-radius: 1em;
font-size: 20pt;
@DotNetNerd
DotNetNerd / PhantomRunner.cs
Created May 23, 2013 11:20
Grabbing a site in C# using phantomJS
class Program
{
static void Main(string[] args)
{
var grabby = new Grabby();
string output = grabby.Grab("http://www.dotnetnerd.dk/cv");
Console.WriteLine(output);
File.WriteAllText("c:\\test.html", output);
}
@DotNetNerd
DotNetNerd / AzureServiceBus.cs
Created May 24, 2013 08:53
Basic sample of using Azure service bus
/* Init */
string connectionString = "Endpoint=sb://xxx.servicebus.windows.net/;SharedSecretIssuer=owner;SharedSecretValue=xxx";//CloudConfigurationManager.GetSetting("Microsoft.ServiceBus.ConnectionString");
var namespaceManager = NamespaceManager.CreateFromConnectionString(connectionString);
/* Setup */
if (!namespaceManager.TopicExists("TestTopic"))
@DotNetNerd
DotNetNerd / typeahead.ts
Last active December 14, 2017 12:47
Type(Script)Ahead
interface ITypeaheadArgs
{
minChars?: number,
onSelect?: () => void
}
async function typeahead(
field: HTMLInputElement,
search: (text: string) => Promise<string[]>,
args: ITypeaheadArgs) {