Skip to content

Instantly share code, notes, and snippets.

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

Aaron Powell aaronpowell

😶‍🌫️
View GitHub Profile
@robdmoore
robdmoore / Add-ToHostsFile.ps1
Created July 23, 2014 08:17
Script to set up ASP.NET development environment in IIS with SQL Express using Network Service
# Originally from http://poshcode.org/3819
function Add-ToHostsFile {
<#
.DESCRIPTION
This function checks to see if an entry exists in the hosts file.
If it does not, it attempts to add it and verifies the entry.
.EXAMPLE
Add-ToHostsFile -IPAddress 192.168.0.1 -HostName MyMachine
@robdmoore
robdmoore / setup-cordova-phonegap.ps1
Last active September 13, 2023 16:04
Scripted/Automated installation script to set up Cordova/PhoneGap and Android on Windows
# Run this in an elevated PowerShell prompt
<# This script worked on a fresh Windows Server 2012 VM in Azure and the following were the latest versions of each package at the time:
* Chocolatey 0.9.8.27
* java.jdk 7.0.60.1
* apache.ant 1.8.4
* android-sdk 22.6.2
* cordova 3.5.0-0.2.6
* nodejs.install 0.10.29
#>
# Note: there is one bit that requires user input (accepting the Android SDK license terms)
@ducas
ducas / Octopus-Umbraco.psm1
Last active August 29, 2015 14:04
Umbraco helpers for Octopus Deploy
function Set-UmbracoPermissions($SitePath, $AppPoolAccount, $PathOverrides)
{
$readExecute = $AppPoolAccount,"ReadAndExecute","ContainerInherit, ObjectInherit","None","Allow"
$read = $AppPoolAccount,"Read","ContainerInherit, ObjectInherit","None","Allow"
$modify = $AppPoolAccount,"Modify","ContainerInherit, ObjectInherit","None","Allow"
$fileModify = $AppPoolAccount,"Modify","Allow"
$objects = @{}
$objects["App_Browsers"] = $readExecute
$objects["App_Code"] = $modify
@fekberg
fekberg / DepthFirstSearch.cs
Last active August 29, 2015 13:56
Depth First Search
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 August 29, 2015 13:56
example Gruntfile for grunt-sweet.js
module.exports = function(grunt) {
grunt.initConfig({
sweetjs: {
options: {
modules: ['es6-macros'],
sourceMap: true,
nodeSourceMapSupport: true
},
src: {
@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
@slashdotdash
slashdotdash / README.md
Last active September 19, 2019 18:30
React + D3 (v2)

Multi-series bar chart rendered using React and D3.

@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);
});
@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
@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.