This is a function that does some currying:
add = (a,b) ->
if not b?
return (c) ->
c + a
a + b
public class ThroughputMessageHandler : DelegatingHandler | |
{ | |
private readonly ILogger _logger; | |
private Timer _timer; | |
private int _count; | |
public ThroughputMessageHandler(ILogger logger) | |
{ | |
_logger = logger; | |
_count = 0; | |
_timer = new Timer(new TimerCallback(timerCallback),null,1000,1000); |
$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> |
This is a function that does some currying:
add = (a,b) ->
if not b?
return (c) ->
c + a
a + b
<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> |
An iterator is an object with a next
method that returns { done, value }
tuples.
An iterable is an object which has an internal method, written in the specs as obj[@@iterator]()
, that returns an iterator. It is not currently specified how to give your own objects such an internal method.
A generator is a specific type of iterator which also has a throw
method, and whose next
method takes a parameter.
A generator function is the source of a generator; you can send values or exceptions into the body of the function via the returned generator's next
and throw
methods. They are created with function*
syntax.
var fs = require('fs'); | |
var pathJoin = require('path').join; | |
// Given a repo instance and a fs path, import the path (recursivly) and return | |
// the final root hash. Supports symlinks and executable files. | |
module.exports = function (repo, path, callback) { | |
return importPath(repo, path, function (err, stat) { | |
if (err) return callback(err); | |
return callback(null, stat.hash); | |
}); |
macro => { | |
rule infix { ( $arg:ident (,) ... ) | { $body ... $last:expr } } => { | |
(function x( $arg (,) ... ) { | |
$( $body) ... | |
return $last | |
}).bind(this); | |
} | |
rule infix { ( $arg:ident (,) ... ) | $last:expr } => { | |
(function x( $arg (,) ... ) { | |
return $last |