Skip to content

Instantly share code, notes, and snippets.

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

Aaron Powell aaronpowell

😶‍🌫️
View GitHub Profile
@aaronpowell
aaronpowell / BulkNuGetInstall.ps1
Created February 25, 2011 02:26
Install NuGet across all projects
#Installs a package into all projects in the solution (note: Requires NuGet 1.1+)
Get-Project -All | Install-Package packageName
@aaronpowell
aaronpowell / FieldMacro.cs
Created March 2, 2011 12:55
A macro to convert a field to a property, also adds c#-esq naming
public class FieldMacro : AbstractAstMacro
{
public override Statement Expand(MacroStatement macro)
{
if (macro.Arguments.Count == 1)
{
var tryCastExpression = (TryCastExpression)macro.Arguments.First;
var referenceExpression = (ReferenceExpression)tryCastExpression.Target;
var property = new Property(referenceExpression.Name)
@aaronpowell
aaronpowell / NuGet-Updator.ps1
Created March 15, 2011 05:37
Updates all packages across all projects using NuGet
#Created by Steve Godbold
Get-Package -Updates | Update-Package
@aaronpowell
aaronpowell / CustomerController.cs
Created May 17, 2011 03:42 — forked from PaulStovell/CustomerController.cs
JavaScript Editing - How would you improve this?
public class CustomerController : Controller
{
public CustomerRepository Repository = new CustomerRepository();
public ActionResult Index()
{
return View();
}
public JsonResult List()
@aaronpowell
aaronpowell / Delete-Assemblies.ps1
Created July 4, 2011 23:38
Recursively delete DLLs in /bin folders
Get-ChildItem src -recurse -include *.dll | foreach ($_) {
if($_.fullname.Contains("bin\")) {
remove-item $_.fullname
}
}
@aaronpowell
aaronpowell / q1.js
Created July 11, 2011 01:02
Q1 - Truth about False
var a = 1,
b = 'hello',
c = 0,
d = true,
e;
e = a && b && c && d;
console.log(e);
@aaronpowell
aaronpowell / fiddle.js
Created July 17, 2011 23:31
Q2 - Does it run?
doStuff();
var stuff = 24;
function doStuff() {
stuff = 42;
};
console.log(stuff);
@aaronpowell
aaronpowell / fiddle.js
Created July 22, 2011 04:18
js function trick
foo();
var foo = function() {
console.log('I\'m fooing');
};
@aaronpowell
aaronpowell / fiddle.js
Created July 25, 2011 01:33
Q3 - To array or not to array?
var array = ???
function print(x) {
var s = '';
for(var i = 0, il = x.length; i < il; i++) {
s += (' ' + x[i]);
}
console.log(s);
@aaronpowell
aaronpowell / fiddle.js
Created August 1, 2011 02:41
Q4 - Who's the owner?
function Person(name, age) {
this.name = name;
this.age = age;
};
function Employee(name, age, company, jobTitle) {
Person.call(this, company, jobTitle);
this.company = company;
this.jobTitle = jobTitle;
}