This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" =================================================== | |
" Misc settings | |
" =================================================== | |
set tabstop=2 " Show existing tab with 2 spaces width | |
set shiftwidth=2 " when indenting with '>', use 2spaces width | |
set noswapfile " Disable swapfiles | |
set autoread " Autoread external changes | |
set number " Enable numbered lines |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) Microsoft. All rights reserved. | |
using System.ComponentModel; | |
using Microsoft.SemanticKernel; | |
namespace Plugins; | |
public class MathPlugin | |
{ | |
[KernelFunction, Description("Take the square root of a number")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Extensions.DependencyInjection; | |
using Microsoft.SemanticKernel; | |
var kernelBuilder = Kernel.CreateBuilder() | |
.AddOpenAIChatCompletion( | |
modelId: "ollama-model-name" | |
apiKey: "can-be-what-ever"); | |
kernelBuilder.Services.ConfigureHttpClientDefaults(e => | |
e.ConfigurePrimaryHttpMessagehandler(() => new ExampleRedirectHandler())); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open FSharp.Data | |
open System.Globalization | |
[<Literal>] | |
let ResolutionFolder = __SOURCE_DIRECTORY__ | |
// Schema can also be set to "" if you want it to auto generate | |
// column names similar to: Column1, Column2 | |
type TargetCSV = CsvProvider< | |
"./test.csv", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.ComponentModel.DataAnnotations; | |
namespace DotnetConsoles.Configuration.Api; | |
public class ApiSettings | |
{ | |
[Required, Url, MinLength(10), ] | |
public string WebhookUrl { get; set; } = null!; | |
[Required, MinLength(3)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-ChildItem -Recurse -File | | |
Group-Object Length | | |
Where-Object { $_.Count -gt 1 } | | |
select -ExpandProperty group | | |
foreach { Get-FileHash -LiteralPath $_.FullName } | | |
group -Property hash | | |
where { $_.count -gt 1 } | | |
select -ExpandProperty group |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-ChildItem -Path HKLM:\System\Setup\Source* | ForEach-Object {Get-ItemProperty -Path Registry::$_} | Select-Object ProductName, ReleaseID, CurrentBuild, @{n="Install Date"; e={([DateTime]'1/1/1970').AddSeconds($_.InstallDate)}} | Sort-Object "Install Date" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func_gitprune() { | |
echo 'Starting git prune' | |
echo "Found $(git branch | wc -l) number of local branches" | |
echo "Starts prune of origin branches...." | |
git remote prune origin | |
echo "Local branches which can be removed:" | |
git branch -vv | grep 'origin/.*: gone]' | awk '{print $1}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Network troubleshooting | |
1. Check /etc/sysctl.conf | |
Specifically: | |
* net.core.netdev_max_backlog | |
* net.core.rmem_max | |
* net.core.rmem_default | |
Example values for default: | |
* net.core.netdev_max_backlog = 1000 | |
* net.core.rmem_max = 131071 | |
* net.core.rmem_default = 163480 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Reference: https://docs.microsoft.com/en-us/previous-versions/azure/jj193022(v=azure.10)?redirectedfrom=MSDN | |
# Before you can get started, you'll have to install the service it self with Web Platform installer. | |
# A direct link to binary it self can be found on the page from reference link. | |
# Prerequisites | |
# 1. Make sure you have SQL Express installed (at least 2012) | |
# 2. Make sure you have installed the service it self (it won't start until configured) | |
# You can verify this by looking for 'Windows Fabric Host Service' amongst windows services. |
NewerOlder