View BusExtensions.cs
public static class BusExtensions | |
{ | |
public static Task ConnectionAwaiter(this IBus bus) | |
{ | |
var cts = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously); | |
bus.Advanced.Connected += (s, e) => | |
{ | |
cts.TrySetResult(true); | |
}; |
View Python SimpleHTTPServer: Serve specific directory
#! /usr/bin/env python | |
import posixpath | |
import argparse | |
import urllib | |
import os | |
from SimpleHTTPServer import SimpleHTTPRequestHandler | |
from BaseHTTPServer import HTTPServer |
View MessageService.ts
import * as angular from 'angular'; | |
import { Observable, Subject, Subscription } from '@reactivex/rxjs'; | |
export interface Message { | |
channel: Function; | |
content: any; | |
} | |
/** | |
* @description AngularJS service singleton implementing simple publish/subscribe message bus to provide decoupled communication of commands & events |
View iframe-tracker.component.html
<div> | |
<iframe appIframeTracker (iframeClick)="onIframeClick()" src="http://www.google.com"></iframe> | |
</div> |
View Program.cs
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Reflection; | |
using Newtonsoft.Json; | |
using Syroot.BinaryData; | |
using Syroot.BinaryData.Extensions; | |
namespace ConsoleApp1 |
View super-mario.ino
/* | |
Arduino Mario Bros Tunes | |
With Piezo Buzzer and PWM | |
Connect the positive side of the Buzzer to pin 3, | |
then the negative side to a 1k ohm resistor. Connect | |
the other side of the 1 k ohm resistor to | |
ground(GND) pin on the Arduino. | |
by: Dipto Pratyaksa |
View star-wars.ino
const int c = 261; | |
const int d = 294; | |
const int e = 329; | |
const int f = 349; | |
const int g = 391; | |
const int gS = 415; | |
const int a = 440; | |
const int aS = 455; | |
const int b = 466; |
View ChannelPoolingClientCommandDispatcher.cs
using System; | |
using System.Collections.Concurrent; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using EasyNetQ; | |
using EasyNetQ.Producer; | |
using RabbitMQ.Client; | |
namespace EasyNetQSlowerThanRabbitMQ | |
{ |
View TrackEventOperation.cs
public static class TelemetryClientExtensions | |
{ | |
public static IOperationHolder<TrackEventOperation> StartEventOperation(this TelemetryClient client, string eventName) | |
{ | |
return new TrackEventOperationHolder(eventName, client); | |
} | |
} | |
public class TrackEventOperationHolder : IOperationHolder<TrackEventOperation> | |
{ |
View App\Program.cs
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
namespace EFCore.PsToolsIssue7146.App | |
{ | |
public class Program | |
{ | |
public static void Main() |
NewerOlder