Skip to content

Instantly share code, notes, and snippets.

@tkrotoff
tkrotoff / FrontendFrameworksPopularity.md
Last active June 18, 2024 09:59
Front-end frameworks popularity (React, Vue, Angular and Svelte)
public class Args : Dictionary<string,object>{}
public class MyIoc
{
private Dictionary<Type, Dictionary<string, Func<Args, object>>> _registry
= new Dictionary<Type, Dictionary<string, Func<Args, object>>>();
public void Register<T>(Func<Args, T> factory, string name = "") where T : class
{
Type t = typeof(T);
define(['jquery', 'app'], function ($, app) {
return app.factory('Acronym', [function () {
var factory = {
desiredKeyLength: 2,
maxKeyLength: 5,
@jkarsrud
jkarsrud / BundleInstall.md
Last active May 27, 2020 08:51
How to use ASP.NET Bundling and Minifications in Umbraco

How to use ASP.NET Bundling and Minifications in Umbraco

Using the ASP.NET bundling and minifications is pretty straight forward, but here is a small guide that take care of a few gotchas when implementing bundles in your Umbraco project.

Installing ASP.NET Bundling and Minifications

ASP.NET Bundling and Minifications is part of the Microsoft ASP.NET Web Optimization Framework and is installed via NuGet;

PM> Install-Package Microsoft.AspNet.Web.Optimization

Once this is done, you need to create a BundleConfig.cs in your App_Start1 folder. This is where you register your different bundles. It can be extremely simple, or it can be more complex, but the gist of it is this;

@bradwilson
bradwilson / gist:2417226
Created April 18, 2012 22:55
Ninject dependency resolver for Web API
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Web.Http.Dependencies;
using Ninject;
using Ninject.Syntax;
public class NinjectDependencyScope : IDependencyScope
{
private IResolutionRoot resolver;
@rberrelleza
rberrelleza / UseServiceBusFromPowershell.ps1
Created March 27, 2012 23:55
Send and receive messages to a Service Bus queue via PowerShell
Import-Module "PATH_TO_Microsoft.ServiceBus.dll"
#Create the required credentials
$tokenProvider = [Microsoft.ServiceBus.TokenProvider]::CreateSharedSecretTokenProvider("owner", "YOUR_ISSUERSECRET")
$namespaceUri = [Microsoft.ServiceBus.ServiceBusEnvironment]::CreateServiceUri("sb", "YOUR_NAMESPACE", "");
$namespaceManager = New-Object Microsoft.ServiceBus.NamespaceManager $namespaceUri,$tokenProvider
#Create a queue
$queue = $namespaceManager.CreateQueue("MyPowershellQueue");
@niik
niik / CryptoRandom.cs
Created June 9, 2011 21:48
Buffered CryptoRandom implementation based on Stephen Toub and Shawn Farkas' CryptoRandom
/*
* Original version by Stephen Toub and Shawn Farkas.
* Random pool and thread safety added by Markus Olsson (freakcode.com).
*
* Original source: http://msdn.microsoft.com/en-us/magazine/cc163367.aspx
*
* Some benchmarks (2009-03-18):
*
* Results produced by calling Next() 1 000 000 times on my machine (dual core 3Ghz)
*