Skip to content

Instantly share code, notes, and snippets.

@staxmanade
staxmanade / Get-Last-NuGet-Version
Created June 6, 2011 04:09
Powershell function that returns the last version of a NuGet package
function Get-Last-NuGet-Version($nuGetPackageId) {
$feeedUrl = "http://packages.nuget.org/v1/FeedService.svc/Packages()?`$filter=Id%20eq%20'$nuGetPackageId'"
$webClient = new-object System.Net.WebClient
$queryResults = [xml]($webClient.DownloadString($feeedUrl))
$version = $queryResults.feed.entry | %{ $_.properties.version } | sort-object | select -last 1
if(!$version){
$version = "0.0"
}
$version
}
@staxmanade
staxmanade / gist:750881
Created December 22, 2010 00:27
RadDocumentViewerViewModel view
<%@ Control Language="VB" Inherits="System.Web.Mvc.ViewUserControl(Of RadDocumentViewerViewModel)" %>
<div id="rad_document_viewer_container" style="height:100%;">
<iframe src="<%= Model.IFrameSrc %>" id="<%= Model.ControlID %>" frameborder="0" style="height:100%; width:100%; border: 0px none rgb(255, 255, 255);"></iframe>
</div>
@staxmanade
staxmanade / gist:750864
Created December 22, 2010 00:16
RadDocumentViewerViewModel
Public Class RadDocumentViewerViewModel
Private pdfWebControl As PdfWebControl
Property ControlID As String = Guid.NewGuid.ToString().Replace("-", "")
Property DocumentKey As String
Sub New(ByVal specialDocumentKey As String, ByVal documentName As Func(Of String), ByVal fileContents As Func(Of Byte()))
pdfWebControl = New PdfWebControl()
[TestFixture]
public class InheritedFixture
{
protected int _setupValue;
[SetUp]
public void ShouldNotRun()
{
_setupValue = 10;
}