Skip to content

Instantly share code, notes, and snippets.

View lucamilan's full-sized avatar
🏠
Working from home

Luca Milan lucamilan

🏠
Working from home
View GitHub Profile
@lucamilan
lucamilan / 0_reuse_code.js
Created January 14, 2016 13:22
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@lucamilan
lucamilan / parseUrl.js
Created January 12, 2016 14:04 — forked from cmatskas/parseUrl.js
ParseUrl.js
var urlToParse = location.parse.search;
var result = parseQueryString(urlToParse );
console.info(JSON.stringify(result));
@lucamilan
lucamilan / DbSeeder.cs
Created January 3, 2016 16:45 — forked from axelheer/DbSeeder.cs
Implementation of .AddOrUpdate which supports nullables too
using System;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
namespace System.Data.Entity
{
internal static class DbSeeder
{
@lucamilan
lucamilan / FakeDbSet.cs
Created January 3, 2016 16:45 — forked from axelheer/FakeDbSet.cs
Fake implementation of Entity Framework's DbSet for fast unit testing
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using System.Data.Entity.SqlServer;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
@lucamilan
lucamilan / readme.md
Created December 31, 2015 09:03 — forked from elijahmanor/readme.md
Front-End Web Dev Interview Preparation

High Level Questions

  • Can you detail your common development workflow from beginning to end?
  • What types of things do you consider when trying to build a cross-browser web solution?
  • What do you do when you don't know how to do something?
  • How do you continue to learn and sharpen your skills in light of how quickly things change?
  • What is an exciting project that you've worked on recently?

Low Level Questions

@lucamilan
lucamilan / gist:f7e4e2a791f97c686937
Created November 17, 2015 19:12 — forked from amagdas/gist:6078361
Synchronized Queue, blocks on Enqueue if the maximum size is reached.
using System.Collections.Generic;
using System.Threading;
namespace Utilities
{
/// <summary>
/// Synchronized queue which blocks on dequeue.
/// </summary>
/// <typeparam name="T"></typeparam>
public sealed class SynchronizedQueue<T>
@lucamilan
lucamilan / gist:f5b85d33716e5061e212
Last active August 29, 2015 14:25 — forked from philbarresi/gist:55918919f495ab92b3f6
AngularJS Connection Provider for SignalR
// We start our app
var myApp = angular.module("myApp", []);
myApp.provider('connection', function Connection() {
var connection = $.connection,
reconnectDelay = 1500,
maxReconnectDelay = 60000;
// allows you to set logging on before the connection runs
this.showLogging = function () {
@lucamilan
lucamilan / gist:efbfe3746baa624e9a22
Last active August 29, 2015 14:25 — forked from alex-groshev/gist:1e047950cb9b2d12c212
Invoking multiple handlers periodically from Topshelf Windows Service (using System.Threading.Timer)
using System;
using System.Collections.Generic;
using System.Threading;
using Topshelf;
namespace ConsoleApplication
{
public interface IProcess
{
void Perform();
public class RavenDBRegistry:Registry
{
public RavenDBRegistry()
{
var documentStore = new EmbeddableDocumentStore
{
RunInMemory = true
}.Initialize();
For<IDocumentSession>().Use(() => documentStore.OpenSession());
<configuration>
//......
//......
<system.web>
<httpHandlers>
<add path="*.js" verb="GET,HEAD" type="System.Web.StaticFileHandler" />
<add path="*.css" verb="GET,HEAD" type="System.Web.StaticFileHandler" />
<add path="*" verb="*.cshtml" type="System.Web.HttpNotFoundHandler"/>