Skip to content

Instantly share code, notes, and snippets.

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

Aaron Powell aaronpowell

😶‍🌫️
View GitHub Profile
@darrelmiller
darrelmiller / gist:2026145
Created March 13, 2012 02:04
ThroughputMessageHandler
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);
@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"
[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>
@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
@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>
@domenic
domenic / iterators-etc.md
Last active December 22, 2015 10:19
Iterators, iterables, generators

Definitions

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.

@anaisbetts
anaisbetts / doc.md
Last active December 29, 2015 07:29
The smallest number of WinDbg commands you can know to Do Stuff With VS

File => Attach To Process, pick devenv.exe

First, fix the symbols and shit

.symfix
.reload
.loadby sos clr
@creationix
creationix / importfs.js
Last active January 2, 2016 01:58
import existing files into js-git repo for testing
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);
});
@btd
btd / es6-arrows.sjs
Last active January 4, 2016 18:59
One attempt to make arrow functions from es6
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