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
interface ITypeaheadArgs | |
{ | |
minChars?: number, | |
onSelect?: () => void | |
} | |
async function typeahead( | |
field: HTMLInputElement, | |
search: (text: string) => Promise<string[]>, | |
args: ITypeaheadArgs) { |
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
/* 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")) |
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
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); | |
} |
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> | |
<template id="nameTagTemplate"> | |
<style> | |
.outer { | |
border: 2px solid pink; | |
border-radius: 1em; | |
font-size: 20pt; |
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> | |
<style> | |
element { | |
display:none; | |
} | |
</style> | |
<script src="CustomElements/custom-elements.js"></script> |
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
<Application x:Class="WpfApplication1.App" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
Startup="App_OnStartup"> | |
<Application.Resources> | |
<Style TargetType="Button"> | |
<Setter Property="FontSize" Value="20" /> | |
</Style> | |
</Application.Resources> |
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
<Application x:Class="WpfApplication1.App" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
StartupUri="MainWindow.xaml" xmlns:local="clr-namespace:WpfApplication1.ViewModels"> | |
<Application.Resources> | |
<local:ApplicationViewModel x:Key="MyApplicationViewModel" /> | |
</Application.Resources> | |
</Application> |
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
namespace ExtensionFSharp | |
module CollectionExtensions = | |
type System.Collections.Generic.IEnumerable<'a> with | |
member this.ForEach(f:'a -> unit) = | |
for item in this do | |
f item | |
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
open Microsoft.Practices.Unity | |
type IRepository = | |
abstract member FindPhoneNumber : string -> string | |
type Repository() = | |
interface IRepository with | |
member this.FindPhoneNumber(name) = match name with "John" -> "87654321" | _ -> "" | |
let container = new UnityContainer() :> IUnityContainer |
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
.Add("/scripts/libs/rx.min.js") | |
.Add("/scripts/libs/rx.time.min.js") | |
.Add("/scripts/libs/rx.jquery.min.js") | |
var observer = $(e.target).clickAsObservable().bufferWithTime(200) | |
.subscribe(function (events) { | |
console.log(events.length); | |
var $item = $(e.target).closest('.productItem'); | |
var quantity = parseInt($.trim($item.find('.qty').html())) + events.length + 1; |
NewerOlder