Skip to content

Instantly share code, notes, and snippets.

View miguelangelgonzalez's full-sized avatar

Miguel Angel Gonzalez miguelangelgonzalez

View GitHub Profile

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

@KevM
KevM / BootstrapService.cs
Created September 13, 2012 18:40
Example configuration of Topshelf to turn an console application into a Windows service
public class BootstrapService : ServiceControl
{
private readonly HostSettings _settings;
private Container _container;
private CaseMonitor _monitor;
public BootstrapService(HostSettings settings)
{
_settings = settings;
}
@rcknight
rcknight / main.cs
Last active April 25, 2019 13:41
Example Event Store SignalR publisher. For real-time push of events to a web page.
using System;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using EventStore.ClientAPI;
using Microsoft.AspNet.SignalR;
using Microsoft.Owin.Hosting;
using Owin;
namespace EventStoreSignalR
@joladev
joladev / state.js
Last active April 18, 2016 13:28
Simple AngularJS State Service for sharing state between controllers.
angular.module('services', [])
.factory('State', function ($rootScope) {
'use strict';
var state;
var broadcast = function (state) {
$rootScope.$broadcast('State.Update', state);
};
var update = function (newState) {
@mkchandler
mkchandler / DisableNuGetPackageRestore.ps1
Last active February 13, 2018 04:07
Disable the NuGet Package Restore functionality in a Visual Studio solution.
# Usage: .\DisableNuGetPackageRestore.ps1 C:\Path\To\Solution.sln
# Get the path that the user specified when calling the script
$solution = $args[0]
$solutionPath = Split-Path $solution -Parent
$solutionName = Split-Path $solution -Leaf
# Delete the .nuget directory and all contents
Remove-Item (Join-Path $solutionPath ".nuget") -Force -Recurse -ErrorAction 0
@ScottGuymer
ScottGuymer / index.html
Created March 26, 2014 15:31
Angular $http interceptor to allow for a loading spinner whenever any ajax request is made. Could be extended to provide request logging and error handling.
<div id="loadingWidget" loading-widget>
<div class="loadingContent">
<p>
Loading....Loading....Loading....Loading....Loading....Loading....Loading....Loading....Loading....Loading....Loading....Loading....Loading....Loading....Loading....Loading....Loading....Loading....
</p>
</div>
</div>
@scottmcarthur
scottmcarthur / Program.cs
Created April 29, 2014 09:13
Sending complex data to ServiceStack from HTML form synchronously. (ServiceStack v4)
using System;
using ServiceStack;
using ServiceStack.Web;
using ServiceStack.Text;
namespace v4
{
class MainClass
{
public static void Main()
@roshbrahm
roshbrahm / app.html
Created July 9, 2014 10:36
Disable right click i.e. Context Menu and F5 key for refresh in AngularJs
<!DOCTYPE html>
<html ng-app="myapp">
<head>
<title>AngularJs Directive for disabling Context Menu</title>
<style type="text/css">
*.unselectable {
-moz-user-select: -moz-none;
-khtml-user-select: none;
-webkit-user-select: none;
/*
@phatboyg
phatboyg / Program.cs
Created November 5, 2014 23:41
Sample Topshelf service that demonstrates how features can be toggled using the Fooidity Switchyard
namespace ConsoleApplication2
{
using System;
using System.Threading;
using System.Threading.Tasks;
using Autofac;
using Fooidity;
using Topshelf;
@rogeralsing
rogeralsing / gist:d05e4b7cc64a3cfff3b8
Last active March 4, 2018 11:44
Durable Messagebus integration with Akka and Azure Servicebus
using System;
using System.Linq;
using System.Threading.Tasks;
using Akka.Actor;
using Akka.Routing;
using Microsoft.ServiceBus.Messaging;
namespace ConsoleApplication13
{
public class MyBusinessActor : ReceiveActor