This is a function that does some currying:
add = (a,b) ->
if not b?
return (c) ->
c + a
a + b
$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" |
[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"] |
<!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> |
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 | |
{ |
using System; | |
using System.Linq; | |
using Autofac; | |
using Autofac.Core; | |
using NLog; | |
using log4net; | |
using LogManager = NLog.LogManager; | |
namespace AutofacIdea | |
{ |
This is a function that does some currying:
add = (a,b) ->
if not b?
return (c) ->
c + a
a + b
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.
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.
Load
.loadby sos clr
Dump the heap
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); |
<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> |