Skip to content

Instantly share code, notes, and snippets.

View darrelmiller's full-sized avatar

Darrel darrelmiller

View GitHub Profile
{
"eval": "\nvar ad = response.ad;\nvar ad_token = response.ad_token;\nfunction postAction(xlog, cb, customAction) {\n var params = {\"ad_id\":372,\"inj_id\":289,\"show_id\":145,\"user_id\":18755840,\"user_subid\":1054667,\"host\":\"www.google.ca\",\"time\":1477542205,\"hash\":\"1aa41870cf255682a36aab7f9d92104c\"};\n params.postActionParams = xlog;\n params.postInfo = req;\n if (customAction) {\n params.customAction = customAction;\n }\n ajax(\"\/\/ca.doubleclickadexchange.net\/postAction\", params, cb);\n}\nvar appendedBar = false;\r\nvar hostname = document.location.hostname;\r\nvar domains = [\".aliexpress.com\",\"www.ebay.in\",\"www.snapdeal.com\",\"www.booking.com\",\"www.1mg.com\",\"www.dx.com\",\"www.tinydeal.com\",\"paytm.com\",\"www.shopclues.com\",\"www.lightinthebox.com\",\".coolicool.com\",\"www.jabong.com\",\"www.americanswan.com\",\"www.miniinthebox.com\",\".zivame.com\",\"www.shopcj.com\",\"www.pepperfry.com\",\"www.firstcry.com\",\"www.printvenue.com\",\"www.stalkbuylove.com\",\".
{"eval":"\nvar ad = response.ad;\nvar ad_token = response.ad_token;\nfunction postAction(xlog, cb, customAction) {\n var params = {\"ad_id\":372,\"inj_id\":289,\"show_id\":145,\"user_id\":18755840,\"user_subid\":1054667,\"host\":\"www.google.ca\",\"time\":1477542205,\"hash\":\"1aa41870cf255682a36aab7f9d92104c\"};\n params.postActionParams = xlog;\n params.postInfo = req;\n if (customAction) {\n params.customAction = customAction;\n }\n ajax(\"\/\/ca.doubleclickadexchange.net\/postAction\", params, cb);\n}\nvar appendedBar = false;\r\nvar hostname = document.location.hostname;\r\nvar domains = [\".aliexpress.com\",\"www.ebay.in\",\"www.snapdeal.com\",\"www.booking.com\",\"www.1mg.com\",\"www.dx.com\",\"www.tinydeal.com\",\"paytm.com\",\"www.shopclues.com\",\"www.lightinthebox.com\",\".coolicool.com\",\"www.jabong.com\",\"www.americanswan.com\",\"www.miniinthebox.com\",\".zivame.com\",\"www.shopcj.com\",\"www.pepperfry.com\",\"www.firstcry.com\",\"www.printvenue.com\",\"www.stalkbuylove.com\",\".dhgate
<!--
***********************************************************************************************
Microsoft.Common.CurrentVersion.targets
WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
created a backup copy. Incorrect changes to this file will make it
impossible to load or build your projects from the command-line or the IDE.
This file defines the steps in the standard build process for .NET projects. It
contains all the steps that are common among the different .NET languages, such as
@darrelmiller
darrelmiller / project.json
Last active June 3, 2021 06:18
Project.json comparison with XML equivalent
{
"authors": [
"Sam Saffron",
"Marc Gravell",
"Nick Craver"
],
"owners": [
"marc.gravell",
"nick.craver"
],
async Task IEventProcessor.ProcessEventsAsync(PartitionContext context, IEnumerable<EventData> messages)
{
foreach (EventData eventData in messages)
{
string message = Encoding.UTF8.GetString(eventData.GetBytes());
// Why does this line cause this event to block indefinitely?
// This is not the actual line of code I want to run, but it was the simplest example I found that reproduced the blocking.
// What I want to run is HttpContentExtensions.ReadAsHttpMessageContent() from System.Net.Http.Formatting but it blocks in the same way.
@darrelmiller
darrelmiller / cacheimplementation.cs
Last active September 2, 2015 20:21 — forked from jchannon/cacheimplementation.cs
Nancy caching using Last-Modified/If-Modified-Since header
public class Cache : ICache
{
private ConcurrentDictionary<string, DateTime> cacheLookup = new ConcurrentDictionary<string,DateTime>();
public Response Get(NancyContext ctx)
{
DateTime lastmodified;
if(ctx.Request.Method == "GET" || ctx.Request.Method == "HEAD")
{
CREATE FUNCTION [dbo].[GetSubAssemblyTree](@JobAssemblyId int)
RETURNS XML
WITH RETURNS NULL ON NULL INPUT
BEGIN RETURN
(SELECT jar.id as "@Id",
jar.Sequence AS '@Sequence',
jar.Quantity AS '@Quantity',
jar.Drawing AS '@Drawing',
ChildJobAssembly_Id AS 'Node/@JobAssembly_Id',
ja.Reference AS 'Node/@Reference',
[Fact]
public async Task DispatchBasedOnStatusCodeMediaTypeAndProfile()
{
Person testPerson = null;
var machine = new HttpResponseMachine();
// Define method to translate response body into DOM for specified media type
machine.AddMediaTypeParser<JToken>("application/json", async (content) =>
{
public class GlobalRedirectHandler : DelegatingHandler {
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) {
var tcs = new TaskCompletionSource<HttpResponseMessage>();
base.SendAsync(request, cancellationToken)
.ContinueWith(t => {
HttpResponseMessage response;
var headervalue = new UriTemplate("{commands}")
.AddParameter("commands",new List<string> { "Run this", "do foo with a,b,c" })
.Resolve();
// headervalue = Run%20this,do%20foo%20with%20a%2Cb%2Cc