Skip to content

Instantly share code, notes, and snippets.

Get-ChildItem -File -Filter "*.csproj" | ForEach-Object {
New-Item -ItemType Directory $_.BaseName -Force;
Move-Item -Path $_.FullName -Destination $_.BaseName
}
FROM microsoft/aspnet
ARG buildarea=production
RUN echo $env:buildarea
$path = "test"
$filter = "*.config"
#To support both absolute and relative paths..
$pathitem = Get-Item -Path $path
#If sourcepath exists
if($pathitem) {
#Get name for tempfolder
$tempdir = Join-Path $env:temp "CompressArchiveTemp"
@zeqk
zeqk / UsageNHibernateAsync.cs
Created July 5, 2018 13:33 — forked from erdtsieck/UsageNHibernateAsync.cs
This gist shows how to use the NHibernate async API
#region ICriteria async API
// Usage ICriteria.ListAsync<T>()
var customers = await session.CreateCriteria<Customer>().ListAsync<Customer>();
// Usage ICriteria.UniqueResultAsync<T>()
var customer = await session
.CreateCriteria<Customer>()
.Add(Restrictions.Eq("Name", "Erdtsieck"))
.UniqueResultAsync<Customer>();
@zeqk
zeqk / ilmerge_command
Created July 3, 2018 15:04
ILMerge command
ilmerge batsOpener.exe CommandLine.dll Newtonsoft.Json.dll /out:fullBatsOp
ener.exe /targetplatform:'v4,C:\Windows\Microsoft.NET\Framework\v4.0.30319'
@zeqk
zeqk / accessing-virtualbox.md
Created June 15, 2018 15:51
Accessing your Virtualbox Guest from your Host OS

Accessing your Virtualbox Guest from your Host OS

As a developer you want to ping and access the webserver on your virtual machine. This is a very simple solution to enable the bridge to the guest VM.

Requirements

  • VirtualBox (latest version)
  • A guest operation system (e.g. Ubuntu)
param([string]$installationType = "NONE")
Set-Content -Path "modules.txt" -Value "" -Force;
Get-Content "a1f.webapi.$($installationType.ToLower()).sln" |
Select-String 'Project\(' |
ForEach-Object {
$projectParts = $_ -Split '[,=]' | ForEach-Object { $_.Trim('[ "{}]') };
If($projectParts[1].startswith("a1f.")) {
Add-Content -Path "modules.txt" -Value $projectParts[1] -Force;
@zeqk
zeqk / gist:e51ca8ad4366af6f6e5eb165a2a71442
Created January 12, 2018 00:35 — forked from Buthrakaur/gist:1613003
NHibernate QueryOver.List extension to support casting to anonymous types
public static IList<TRes> ListAs<TRes>(this IQueryOver qry, TRes resultByExample)
{
var ctor = typeof (TRes).GetConstructors().First();
return qry.UnderlyingCriteria
.SetResultTransformer(Transformers.AliasToBeanConstructor(ctor))
.List<TRes>();
}
[Fact]
public void ListAs_Should_CastQueryOverResultToTypeSameAsSupliedExampleInstance()
var request = new XMLHttpRequest();
request.open('GET', '/bar/foo.txt', false); // `false` makes the request synchronous
request.send(null);
if (request.status === 200) {
console.log(request.responseText);
}
#region Hide System.Object inherited methods
/// <summary>
/// Determines whether the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>.
/// </summary>
/// <returns>
/// true if the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>; otherwise, false.
/// </returns>
/// <param name="obj">The <see cref="T:System.Object"/> to compare with the current <see cref="T:System.Object"/>. </param><filterpriority>2</filterpriority>
[EditorBrowsable(EditorBrowsableState.Never)]