Skip to content

Instantly share code, notes, and snippets.

@Brogie
Brogie / ConsoleMenu
Last active January 26, 2017 16:42
This will make a menu for the console in C#
static int Menu(string[] inArray) {
bool loopComplete = false;
int topOffset = Console.CursorTop;
int bottomOffset = 0;
int selectedItem = 0;
ConsoleKeyInfo kb;
Console.CursorVisible = false;
//this will resise the console if the amount of elements in the list are too big
using System;
using System.Collections.ObjectModel;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Web.Http;
using System.Web.Http.Controllers;
using System.Web.Http.Description;
using System.Web.Http.Routing;
@dnozay
dnozay / _Jenkins+Script+Console.md
Last active May 21, 2025 00:30
jenkins groovy scripts collection.
<?xml version="1.0" encoding="utf-16"?>
<Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns">
<TypePattern DisplayName="COM interfaces" Priority="2000">
<TypePattern.Match>
<And>
<Kind Is="Interface" />
<Or>
<HasAttribute Name="System.Runtime.InteropServices.InterfaceTypeAttribute" />
<HasAttribute Name="System.Runtime.InteropServices.ComImport" />
</Or>
@philcleveland
philcleveland / choco.bat
Last active September 10, 2015 20:46
Chocolatey Windows Box setup
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="googlechrome " />
<package id="notepadplusplus.install"/>
<package id="githubforwindows"/>
<package id="javaruntime"/>
<package id="7zip.install"/>
<package id="adobereader"/>
@dfch
dfch / HttpClient.cs
Last active April 12, 2025 14:16
HttpClient and how to use Headers, Content-Type and PostAsync
// HttpClient and how to use Headers, Content-Type and PostAsync
// http://d-fens.ch/2014/04/12/httpclient-and-how-to-use-headers-content-type-and-postasync/
// Copyright 2014-2015 Ronald Rink, d-fens GmbH
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
@davidfowl
davidfowl / dotnetlayout.md
Last active November 1, 2025 05:50
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@dnozay
dnozay / script.groovy
Last active June 27, 2019 17:16
Jenkins - add badge & summary to promoted build
// When using the Promoted Build plugin, you may want to perform some operations
// then you may also want to add badges or a summary to the target build as
// opposed to the promotion build. This script assumes that you have a manual
// promotion process with a parameter called RELEASE_VERSION (hence requiring
// user input); the content that follows would be what you put as a Groovy
// Postbuild action on the promotion process.
import org.jvnet.hudson.plugins.groovypostbuild.*;
def add_release_version(promotion) {
@StephenCleary
StephenCleary / ObservableProgress.cs
Last active April 16, 2024 11:22
ObservableProgress
using System;
using System.Reactive.Linq;
using System.Threading;
/// <summary>
/// Helper methods for using observable <see cref="IProgress{T}"/> implementations. These are hot observables.
/// </summary>
public static class ObservableProgress
{
/// <summary>
@lennybacon
lennybacon / VsProjecItemBatch.ps1
Last active February 29, 2016 10:06
Batch processing Visual Studio ProjectItems with the Nuget Package Management Powershell Console
function Search-ItemsRecursive($projectItems, $list){
ForEach ($item in $projectItems) {
$itemName = $item.Name
Write-Host "Getting all project items for $itemName"
$list.Add($item);
if($item.ProjectItems -ne $null){
Search-ItemsRecursive -projectItems $item.ProjectItems -list $list
}
if($item.SubProject -ne $null -and $item.SubProject.ProjectItems -ne $null){
Search-ItemsRecursive -projectItems $item.SubProject.ProjectItems -list $list