This file contains hidden or 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
| function Get-DirectoryContent { | |
| <# | |
| .SYNOPSIS | |
| Function to get directory content | |
| .EXAMPLE | |
| Get-DirectoryContent -Path "C:\" -HeaderName "poshserver.net" -RequestURL "http://poshserver.net" -SubfolderName "/" | |
This file contains hidden or 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
| <Project Sdk="Microsoft.NET.Sdk.Web"> | |
| <PropertyGroup> | |
| <TargetFramework>netcoreapp3.0</TargetFramework> | |
| </PropertyGroup> | |
| </Project> |
This file contains hidden or 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 connection to SQL Server | |
| function Open-SqlConnection { | |
| param ( | |
| [Parameter(Mandatory)][string] $Server, | |
| [string] $Database, | |
| [string] $User, | |
| [string] $Password) | |
| $connection = New-Object System.Data.SqlClient.SqlConnection |
This file contains hidden or 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 Dapper; | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Data; | |
| using System.Threading.Tasks; | |
| namespace Transacter | |
| { | |
| public static class IDbTransactionExtensions | |
| { |
This file contains hidden or 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
| USE [master]; | |
| GO | |
| DECLARE @sql NVARCHAR(MAX); | |
| ------ Views ------ | |
| DECLARE @view_name NVARCHAR(1024); | |
| SELECT TOP 1 | |
| @view_name = N'[' + [s].[name] + N'].[' + [v].[name] + N']' |
This file contains hidden or 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
| USE [master]; | |
| GO | |
| IF OBJECT_ID('tempdb..#GeoLite2CityLocations') IS NOT NULL | |
| DROP TABLE [tempdb]..[#GeoLite2CityLocations]; | |
| CREATE TABLE [#GeoLite2CityLocations] | |
| (PRIMARY KEY ([geoname_id]) | |
| , [geoname_id] INT NOT NULL | |
| , [locale_code] NVARCHAR(16) NULL |
This file contains hidden or 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
| type Split = double | |
| type Lap = { Num : int; Split : Split } | |
| type RunnerLap = { Lap : Lap; TotalTime : double } | |
| let lap1 = { Num = 1; Split = 1.23 } | |
| let lap2 = { Num = 2; Split = 1.13 } | |
| let lap3 = { Num = 3; Split = 1.03 } | |
| let laps = [lap1;lap2;lap3] | |
| let runnerLapsAccumulator = |
This file contains hidden or 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
| package main | |
| import ( | |
| "fmt" | |
| ) | |
| // Nums is a wrapper around []int | |
| type Nums []int | |
| // Nodes represents an arbitrarily nested tree structure of Node structsß |
This file contains hidden or 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
| //Controllers/HomeController.cs | |
| using Microsoft.AspNetCore.Mvc; | |
| namespace EmptyWebApp.Controllers | |
| { | |
| public class HomeController : Controller | |
| { | |
| public IActionResult Index() | |
| { | |
| return View(); |
This file contains hidden or 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 Cinch.Sequel; | |
| using Dapper; | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Data; | |
| using System.Linq; | |
| using System.Threading.Tasks; | |
| namespace DapperSequelRepo | |
| { |