Skip to content

Instantly share code, notes, and snippets.

@nrrrdcore
nrrrdcore / inset_input.css
Created August 9, 2012 23:35
The Perfect Inset Input CSS
input {
height: 34px;
width: 100%;
border-radius: 3px;
border: 1px solid transparent;
border-top: none;
border-bottom: 1px solid #DDD;
box-shadow: inset 0 1px 2px rgba(0,0,0,.39), 0 -1px 1px #FFF, 0 1px 0 #FFF;
}
@erichexter
erichexter / gist:3717010
Created September 13, 2012 19:35
install chocolatey with windows auth proxy
Set-ExecutionPolicy -ExecutionPolicy Unrestricted;$a=new-object net.webclient;$a.proxy.credentials=[system.net.credentialcache]::defaultnetworkcredentials;$a.downloadstring('http://bit.ly/OKgXHP')|iex
@theburningmonk
theburningmonk / gist:3921623
Created October 20, 2012 01:28
F# - helper functions to Start and Wait for a plain Task (not Task<T>)
open System.Threading.Tasks
[<AutoOpen>]
module Async =
let inline awaitPlainTask (task: Task) =
// rethrow exception from preceding task if it fauled
let continuation (t : Task) : unit =
match t.IsFaulted with
| true -> raise t.Exception
| arg -> ()
@RhysC
RhysC / MachineSetup.ps1
Last active May 25, 2016 08:13
Dev machine PC set up **NB* *: You must have your execution policy set to unrestricted for this to work (Set-ExecutionPolicy Unrestricted). There have been reports that RemoteSigned is enough for the install to workUses Chocolatey and PS-Get to do the heavy lifting TAGS chocolatey setup build
$ErrorActionPreference = "Stop"
Set-ExecutionPolicy RemoteSigned
ECHO "Installing PsGet and PS plugins"
iex ((new-object Net.WebClient).DownloadString("http://psget.net/GetPsGet.ps1"))
Install-Module pscx
Install-Module psake
ECHO "FINISHED - Installing PsGet and PS plugins - FINISHED"
@diegofrata
diegofrata / Repository.fs
Last active December 10, 2015 06:28 — forked from anonymous/Repository.fs
Very Simple MongoDB Repository for F#
open System.Collections
open System.Configuration
open System.Data.Entity.Design.PluralizationServices
open System.Linq
open FluentMongo.Linq
open MongoDB.Bson
open MongoDB.Driver
open MongoDB.Driver.Builders
@clupasq
clupasq / RunnableInDebugOnlyAttribute.cs
Created August 8, 2013 05:45
xUnit.net RunnableInDebugOnlyAttribute
public class RunnableInDebugOnlyAttribute : FactAttribute
{
private string _skip;
public override string Skip
{
get
{
return Debugger.IsAttached
? _skip
@jogleasonjr
jogleasonjr / SlackClient.cs
Last active October 20, 2023 15:54
A simple C# class to post messages to a Slack channel. You must have the Incoming WebHooks Integration enabled. This class uses the Newtonsoft Json.NET serializer available via NuGet. Scroll down for an example test method and a LinqPad snippet. Enjoy!
using Newtonsoft.Json;
using System;
using System.Collections.Specialized;
using System.Net;
using System.Text;
//A simple C# class to post messages to a Slack channel
//Note: This class uses the Newtonsoft Json.NET serializer available via NuGet
public class SlackClient
{
@RhysC
RhysC / 1_MVCHelper.txt
Last active January 2, 2016 16:28
MVC test helpers (.net 4.5) using Log4net, NSubstitute and xUnit. Intend for : - checking attributation of the controller and actions. - asserting ActionResult values in a fluent manner - reducing set up noise for underling type that help form a testable controller
Example usages:
public class MyControllerFixture : IUseFixture<ControllerFixtureInit>
{
private readonly MyController _sut;
private ControllerTestContext _controllerTestContext;
private readonly IMyDependency _dependency;
public MyControllerFixture()
{
@scottmcarthur
scottmcarthur / App.ts
Created February 17, 2014 14:33
Source code for http://stackoverflow.com/questions/21796849/angularjs-typescript-routing (Not my personal TypeScript format)
/// <reference path="angular.d.ts" />
/// <reference path="angular-route.d.ts" />
'use strict';
// Create and register modules
var modules = ['app.controllers','app.directives', 'app.filters', 'app.services'];
modules.forEach((module) => angular.module(module, []));
// *** Push ngRoute or $routeProvider won't work ***
@ar3cka
ar3cka / gist:ed2217ee17f6bd3f2a91
Last active February 18, 2023 21:45
CQRS. In Process Command Dispatcher
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Runtime.Remoting.Messaging;
using System.Runtime.Remoting.Proxies;
using System.Threading.Tasks;
namespace Demo
{