Skip to content

Instantly share code, notes, and snippets.

View cpoDesign's full-sized avatar

Pavel cpoDesign

View GitHub Profile
@cpoDesign
cpoDesign / distinctDates.sql
Created April 30, 2017 22:14
SQL - Select distinct dates
SELECT
DISTINCT
CAST(FLOOR(CAST(Created as FLOAT)) as DateTime) as date
FROM
dbo.table
ORDER BY 1 ASC
public class SiteStartupHandler : IApplicationEventHandler
{
public void OnApplicationStarted(UmbracoApplicationBase umbracoApplication,ApplicationContext applicationContext)
{
// Register bunding for umbraco
RegisterStyles(BundleTable.Bundles);
RegisterJavascript(BundleTable.Bundles);
}
private static void RegisterStyles(BundleCollection bundles)
{
<add key="umbracoReservedPaths" value="~/umbraco,~/install/,~/bundles/" />
@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
#