Skip to content

Instantly share code, notes, and snippets.

View cromwellryan's full-sized avatar

Ryan Cromwell cromwellryan

View GitHub Profile
@cromwellryan
cromwellryan / PrependZerosWithPS
Created May 25, 2011 16:01
Prepend Zeros to files via PS
function number-part($name) { return $name.Split(' ')[0] }
function prepend-if-needed($fi) {
$numberpart = number-part $fi.Name
$potentialnewname = "0" + $fi.Name
if( $numberpart.length -lt 2 ) { ren -Path $fi.FullName -NewName $potentialnewname }
}
ls | foreach { prepend-if-needed $_ }
using EchelonTouchInc.Gister.Api.Credentials;
namespace EchelonTouchInc.Gister.Api
{
public interface GitHubSender
{
string SendGist(string fileName, string content, GitHubCredentials credentials);
}
}
@cromwellryan
cromwellryan / Task.js
Created January 24, 2012 14:11
Knockout & Jasmine not mixing well
var TASKLISTMODULE = (function(module) {
module.Task = function (name, owner, duedate, status) {
var self = this;
self.name = ko.observable(name || '');
self.owner = ko.observable(owner || '');
self.duedate = ko.observable(duedate);
self.status = status || 'unassigned';
@cromwellryan
cromwellryan / Abstract.txt
Created January 26, 2012 04:34
Rock your development environment!
Rock your development environment!
You see Visual Studio more than you see your family. Make your tools rock for you! In this session
we'll look at extensions, tools, customizations, and patterns to developing on the .Net stack which
can have you fly through code like Chipotle through a geek.
@cromwellryan
cromwellryan / age.coffee
Created February 14, 2012 01:15
CoffeeScript Birthday
age = (bday) ->
// now - bday
17
using System;
using EchelonTouchInc.Gister.Api;
using EchelonTouchInc.Gister.Api.Credentials;
namespace EchelonTouchInc.Gister
{
public class RetrievesUserEnteredCredentials : RetrievesCredentials
{
public RetrievesUserEnteredCredentials()
{
using System;
using EchelonTouchInc.Gister.Api;
using EchelonTouchInc.Gister.Api.Credentials;
namespace EchelonTouchInc.Gister
{
public class RetrievesUserEnteredCredentials : RetrievesCredentials
{
public RetrievesUserEnteredCredentials()
{
@cromwellryan
cromwellryan / MyWebApiIntegrationTests.cs
Created February 29, 2012 16:19
SelfHostWebApiTests
[TestFixture]
public class MyWebApiIntegrationTests
{
[Test]
public void ShouldWorkWithWebApi4()
{
var config = new HttpSelfHostConfiguration("http://localhost:8080");
using System;
using OpenQA.Selenium;
using OpenQA.Selenium.IE;
using OpenQA.Selenium.Internal;
namespace AtddDotNetSpecs.StepDefinitions
{
public class DriverFactory
{
static InternetExplorerDriver currentWebDriver;
function Start-GitFetch() {
pushd .
cd ~/vim-config
git fetch origin
cd ~/git-config
git fetch origin master
cd ~/ps-config
git fetch origin master