Skip to content

Instantly share code, notes, and snippets.

# download the package
Write-Host "Downloading $url to $file"
$cred = get-credential
$proxy = New-Object System.Net.WebProxy("proxyserver")
$proxy.credentials = $cred.GetNetworkCredential();
$downloader = new-object System.Net.WebClient
$downloader.proxy = $proxy
$downloader.DownloadFile($url, $file)
# variables
$url = "http://packages.nuget.org/v1/Package/Download/Chocolatey/0.9.8.4"
$chocTempDir = Join-Path $env:TEMP "chocolatey"
$tempDir = Join-Path $chocTempDir "chocInstall"
if (![System.IO.Directory]::Exists($tempDir)) {[System.IO.Directory]::CreateDirectory($tempDir)}
$file = Join-Path $tempDir "chocolatey.zip"
# download the package
Write-Host "Downloading $url to $file"
$downloader = new-object System.Net.WebClient
Option Strict Off
Imports System.Data.SqlServerCe
Imports System.IO
Module Module1
Sub Main()
CreateDatabase()
CreateTables()
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlServerCe;
namespace SimpleDataC
{
class Program
{
using EasyHttp.Infrastructure;
using Machine.Specifications;
namespace EasyHttp.Specs.Specs
{
public class When_baseuri_is_null_and_query_is_null
{
Establish context = () =>
{
uriComposer = new UriComposer();
@chrissie1
chrissie1 / gist:3372616
Created August 16, 2012 18:53
this should fail. In old VB.
Imports System.Dynamic
Module Module1
Sub Main()
Dim c2 As Object = New C
Module Module1
Sub Main()
Dim s = New subclass
s.test()
Console.ReadLine()
End Sub
Public Interface IInterface
Sub test()
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
@chrissie1
chrissie1 / gist:4299744
Created December 15, 2012 22:09
This should work but needs some locking on the set.
internal static class Container
{
private static class PerType<T>
{
public static ILog Log;
}
public static ILog GetOrAdd<T>()
{
var log = PerType<T>.Log;
@chrissie1
chrissie1 / PackageSorter.cs
Last active December 13, 2015 18:58
Sorting chcolatey Pacakges On version
using System;
using System.Collections.Generic;
namespace OrderPackages
{
public class PackagesSorter:IComparer<string>
{
private static readonly char LevelSeperator = ".".ToCharArray()[0];
private const string PreRelease = "-pre";