Skip to content

Instantly share code, notes, and snippets.

View cpoDesign's full-sized avatar

Pavel cpoDesign

View GitHub Profile
@cpoDesign
cpoDesign / actor-poison-pill.cs
Created April 6, 2017 21:28
Akka.NET PoisonPill
// The fact that user actor is created using the props does not mean
// anything as it needs to be registered with the system to know about it.
Props demoActorRef = Props.Create<MyDemoActor>();
// Lets register the actor with the system
IActorRef actorRef = BulkProcessingSystem.ActorOf(demoActorRef, "DemoActor");
// Send message to the actor
actorRef.Tell("Akka.net rocks");
@cpoDesign
cpoDesign / calculator.feature
Created April 5, 2017 12:20
Specflow calculator feature definition and scenario
Feature: Calculator
In order to avoid silly mistakes
As a math idiot
I want to be told the sum of two numbers
@mytag
Scenario: Add two numbers
Given I have entered 50 into the calculator
And I have also entered 70 into the calculator
When I press add
@cpoDesign
cpoDesign / demo.cs
Created April 4, 2017 20:18
Example
public class DemoClass
{
public string Message {get;set;}
}
@cpoDesign
cpoDesign / config-embeddedMedia.config
Created March 7, 2017 08:23
Add twitter embed support to the Umbraco embed em all Add this snippet to /config/embeddedMedia.config
<!-- Twitter Settings -->
<provider name="Twitter" type="Umbraco.Web.Media.EmbedProviders.OEmbedRich, umbraco">
<urlShemeRegex><![CDATA[twitter\.com/]]></urlShemeRegex>
<apiEndpoint><![CDATA[https://api.twitter.com/1/statuses/oembed.xml]]></apiEndpoint>
<requestParams type="Umbraco.Web.Media.EmbedProviders.Settings.Dictionary, umbraco">
</requestParams>
</provider>
@cpoDesign
cpoDesign / ActorSystemRefs.cs
Last active March 7, 2017 07:45
Example of actor system register with application
public class ActorSystemRefs
{
public static Akka.Actor.ActorSystem ActorSystem;
}
@cpoDesign
cpoDesign / Example.html
Created August 13, 2016 22:22
Monitoring $http Activity With $http Interceptors In AngularJS
<!doctype html>
<html ng-app="Demo">
<head>
<meta charset="utf-8" />
<title>
Monitoring $http Activity With $http Interceptors In AngularJS
</title>
<link rel="stylesheet" type="text/css" href="./demo.css"></link>
@cpoDesign
cpoDesign / .tfignore
Created July 8, 2016 14:37
TFS ignore items
######################################
# Ignore .cpp files in the ProjA sub-folder and all its subfolders
ProjA\*.cpp
#
# Ignore .txt files in this folder
\*.txt
#
# Ignore .xml files in this folder and all its sub-folders
*.xml
#
Statistical analysis of page load speed data collected using the Navigation Timing API shows that an HTTP request can be reasonably approximated to 0.5 seconds.
Permalink to this heading.
Introduction
Whilst newer browsers implement a timing API that can give the time for a request including network latency, this is not available in all browsers. In browsers that do not support the timing API it is only possible, using on page JavaScript, to measure the time taken from the start of the DOM loading to a subsequent event - such as DOM ready. Using information from browsers that support the timing API it is possible to measure both the time from request to DOM ready and the time from DOM start to DOM ready and establish a relationship such that request_time = multiplier x dom_time + constant. Once this relationship is known it can be applied when only the DOM loading to ready time is available to estimate the full request time.
Permalink to this heading.
Method
From visitors that were using a browser that had
@cpoDesign
cpoDesign / gist:03084df8cbcef0e8f7db5ebe62a7d649
Created June 30, 2016 17:30
Non working link for IE9 & Angular 1.2.4
<a href="#" ng-click="doSomeAction()">some action</a>
@cpoDesign
cpoDesign / _favIcons.html
Last active June 7, 2016 08:41
Example of setting up fav icons for Apple +Android + Windows 8/10 + chrome
<!-- iPad and iPad mini (with @2× display) iOS ≥ 8 -->
<link rel="apple-touch-icon-precomposed" sizes="180x180" href="img/touch/apple-touch-icon-180x180-precomposed.png">
<!-- iPad 3+ (with @2× display) iOS ≥ 7 -->
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="img/touch/apple-touch-icon-152x152-precomposed.png">
<!-- iPad (with @2× display) iOS ≤ 6 -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="img/touch/apple-touch-icon-144x144-precomposed.png">
<!-- iPhone (with @2× and @3 display) iOS ≥ 7 -->
<link rel="apple-touch-icon-precomposed" sizes="120x120" href="img/touch/apple-touch-icon-120x120-precomposed.png">
<!-- iPhone (with @2× display) iOS ≤ 6 -->
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="img/touch/apple-touch-icon-114x114-precomposed.png">