I hereby claim:
- I am jeroenheijmans on github.
- I am jeroenheijmans (https://keybase.io/jeroenheijmans) on keybase.
- I have a public key ASAzXzBDLZAU_aCj3dB_dN4cDqCTyka3DSPFCMK-0hMBxwo
To claim this, I am signing this object:
<# | |
# It can be called like this: | |
$url ="http://localhost:12345/home/upload" | |
$form = @{ description = "Test 123." } | |
$pwd = ConvertTo-SecureString "s3cr3t" -AsPlainText -Force | |
$creds = New-Object System.Management.Automation.PSCredential ("john", $pwd) | |
Get-ChildItem *.txt | Send-MultiPartFormToApi $url $form $creds -Verbose -WhatIf | |
#> |
/* DISCLAIMER: | |
* This code is pure adhoc magic. NO WARRANTY or guarantees or | |
* whatsoever! Use at your own risk!! | |
*/ | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace CsharpBuddy |
I hereby claim:
To claim this, I am signing this object:
{ | |
"id": "5960b8fe99b1151dc82b6cb8", | |
"name": "LPIC-1 101 Study Guide", | |
"desc": "", | |
"descData": null, | |
"closed": false, | |
"idOrganization": null, | |
"invited": false, | |
"pinned": false, | |
"starred": false, |
/* | |
* Create a new Class Library and copy/paste this file over the class1.cs file. | |
* | |
* On Package Mananager Console: | |
* | |
* @("MSTest.TestFramework","MSTest.TestAdapter","EntityFramework") | foreach { Install-Package $_ } | |
* | |
* Run `sqllocaldb c soquestion` to create the instance. | |
* Afterwards create database `TestDb` e.g. with SSMS on that instance. | |
*/ |
/* | |
* Create a new Class Library and copy/paste this file over the class1.cs file. | |
* | |
* On Package Mananager Console: | |
* | |
* @("MSTest.TestFramework","MSTest.TestAdapter","EntityFramework") | foreach { Install-Package $_ } | |
* | |
* Run `sqllocaldb c soquestion` to create the instance. | |
* Afterwards create database `TestDb` e.g. with SSMS on that instance. | |
*/ |
# Normal, colored prompt: | |
#function Prompt | |
#{ | |
# $promptString = "PS " + $(Get-Location) + ">" | |
# Write-Host $promptString -NoNewline -ForegroundColor Yellow | |
# return " " | |
#} | |
# Posh-Git prompt | |
function prompt { |
using System; | |
using System.ServiceModel; | |
using System.ServiceModel.Description; | |
using System.Threading.Tasks; | |
namespace WcfMinimalTest | |
{ | |
// WARNING! This minimal repro does no cleanup or error handling whatsoever!! | |
// Loosely based on http://stackoverflow.com/a/7833188/419956 by @Anuraj |
namespace DoubleVsDecimal | |
{ | |
using System; | |
using NUnit.Framework; | |
[TestFixture] | |
public class RangeTests | |
{ | |
static readonly decimal[] interestingDecimals = new decimal[] { | |
decimal.MinValue, |
// CC-BY-SA 3.0, implementation by @LBushkin from http://stackoverflow.com/a/2776689/419956 | |
public static class StringExtensions | |
{ | |
public static string Truncate(this string value, int maxLength) | |
{ | |
if (maxLength < 0) throw new ArgumentOutOfRangeException("maxLength"); | |
if (string.IsNullOrEmpty(value)) return value; | |
return value.Length <= maxLength ? value : value.Substring(0, maxLength); | |
} | |
} |