Skip to content

Instantly share code, notes, and snippets.

View aaronpowell's full-sized avatar
😶‍🌫️

Aaron Powell aaronpowell

😶‍🌫️
View GitHub Profile
@tathamoddie
tathamoddie / gist:5873372
Created June 27, 2013 01:50
Take all app.*.config transforms and run them, producing complete files with the same names
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<UsingTask TaskName="TransformXml" AssemblyFile="$(VSToolsPath)\Web\Microsoft.Web.Publishing.Tasks.dll" />
<Target Name="AfterCompile" Condition="exists('app.$(Configuration).config')">
<!-- Generate transformed app config in the intermediate directory -->
<TransformXml Source="app.config" Destination="$(IntermediateOutputPath)$(TargetFileName).config" Transform="app.$(Configuration).config" />
<!-- Force build process to use the transformed configuration file from now on. -->
<ItemGroup>
@Stuk
Stuk / promise-debug.js
Last active October 2, 2016 21:39
I've found this code useful for debugging promises, to find what order things are happening in. `console.error` gives a stack trace in the Webkit Developer Tools which makes easily narrow down where the promise creation and resolution is happening.
var Q = require("q");
var Set = require("collections/set"); // https://npmjs.org/package/collections
window.outstandingPromises = new Set();
var originalDefer = Q.defer;
Q.defer = function () {
console.error("Deferred created");
var deferred = originalDefer();
deferred.stack = new Error("").stack;
window.outstandingPromises.add(deferred);
@markryd
markryd / memprofiling.md
Last active August 22, 2016 18:36
Memory profiling with windbg
  • Start up windbg and attach (F6).
  • Make sure you pick the right version (x86/x64) and run as admin if your app is running as admin.
  • Make sure you have the microsoft symbol servers turned on in Visual Studio -> tools -> options -> debugging -> symbols

Load

.loadby sos clr

Dump the heap

@domenic
domenic / promises.md
Last active March 31, 2024 14:07
You're Missing the Point of Promises

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.
@liammclennan
liammclennan / blog_currying.md
Created September 6, 2012 10:48
CoffeeScript Currying

This is a function that does some currying:

add = (a,b) ->
  if not b?
    return (c) ->
      c + a
  a + b
@pawelpabich
pawelpabich / LogModule.cs
Created July 7, 2012 13:32
Log4Net and NLog modules for Autofac
using System;
using System.Linq;
using Autofac;
using Autofac.Core;
using NLog;
using log4net;
using LogManager = NLog.LogManager;
namespace AutofacIdea
{
@HenrikFrystykNielsen
HenrikFrystykNielsen / SelfHostWithAssembliesResolver.cs
Created June 10, 2012 23:56
ASP.NET Web API: Controlling assemblies loaded by providing own AssembliesResolver
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Threading.Tasks;
using System.Web.Http;
using System.Web.Http.Dispatcher;
using System.Web.Http.SelfHost;
namespace SelfHost
{
<!DOCTYPE html>
<!-- File > New Project > Templates > JavaScript > Blank App; replace default.html with this -->
<html>
<head>
<meta charset="utf-8" />
<title>App2</title>
<!-- WinJS references -->
<link href="//Microsoft.WinJS.1.0.RC/css/ui-dark.css" rel="stylesheet" />
<script src="//Microsoft.WinJS.1.0.RC/js/base.js"></script>
[alias]
co = checkout
st = status
br = branch
re = rebase
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
cat = cat-file -t
type = cat-file -t
dump = cat-file -p
[color "branch"]
@shiftkey
shiftkey / merge-local-branches.ps1
Created May 21, 2012 01:27
Script to cleanup merged branches locally
$branches = git branch --merged | ?{$_ -notmatch "\* master"} | ?{$_ -notmatch "master"} | ?{$_ -notmatch "\* *"} | %{$_.Trim() }
if (-not $branches) {
echo "No merged branches detected"
exit 0
}
echo $branches
$title = "Delete Merged Branches"