Skip to content

Instantly share code, notes, and snippets.

💭
🐱‍🐉

Aaron Powell aaronpowell

💭
🐱‍🐉
Block or report user

Report or block aaronpowell

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@fekberg
fekberg / DepthFirstSearch.cs
Last active Aug 29, 2015
Depth First Search
View DepthFirstSearch.cs
void Main()
{
// Define all the vertices in the graph
var a = new Vertex<string>{ Value = "A" };
var b = new Vertex<string>{ Value = "B" };
var c = new Vertex<string>{ Value = "C" };
var d = new Vertex<string>{ Value = "D" };
var e = new Vertex<string>{ Value = "E" };
var f = new Vertex<string>{ Value = "F" };
var g = new Vertex<string>{ Value = "G" };
@jlongster
jlongster / Gruntfile.js
Last active Aug 29, 2015
example Gruntfile for grunt-sweet.js
View Gruntfile.js
module.exports = function(grunt) {
grunt.initConfig({
sweetjs: {
options: {
modules: ['es6-macros'],
sourceMap: true,
nodeSourceMapSupport: true
},
src: {
@btd
btd / es6-arrows.sjs
Last active Jan 4, 2016
One attempt to make arrow functions from es6
View es6-arrows.sjs
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
@slashdotdash
slashdotdash / README.md
Last active Sep 19, 2019
React + D3 (v2)
View README.md

Multi-series bar chart rendered using React and D3.

@creationix
creationix / importfs.js
Last active Jan 2, 2016
import existing files into js-git repo for testing
View importfs.js
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);
});
@anaisbetts
anaisbetts / doc.md
Last active Dec 29, 2015
The smallest number of WinDbg commands you can know to Do Stuff With VS
View doc.md

File => Attach To Process, pick devenv.exe

First, fix the symbols and shit

.symfix
.reload
.loadby sos clr
@domenic
domenic / iterators-etc.md
Last active Dec 22, 2015
Iterators, iterables, generators
View iterators-etc.md

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.

@tathamoddie
tathamoddie / gist:5873372
Created Jun 27, 2013
Take all app.*.config transforms and run them, producing complete files with the same names
View gist:5873372
<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 Oct 2, 2016
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.
View promise-debug.js
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 Aug 22, 2016
Memory profiling with windbg
View memprofiling.md
  • 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

You can’t perform that action at this time.