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
CREATE FUNCTION [dbo].[ufnAddBusinessDays] | |
( | |
@Date DATE, | |
@n int -- Number of days to add or substract | |
) | |
RETURNS DATE | |
AS | |
BEGIN | |
DECLARE @d INT,@f INT,@DW INT; | |
Set @f = CAST(abs(1^SIGN(DATEPART(DW, @Date)-(7-@@DATEFIRST))) as bit) |
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
/* | |
This will format a string mimicking the .Net string format. | |
ie: format('test {0} - {1}', 'value 1', 'value 2'); | |
*/ | |
function format(value) { | |
var args = Array.prototype.slice.call(arguments, 1); | |
return value.replace(/{(\d+)}/g, function (match, number) { | |
return typeof args[number] != 'undefined' | |
? args[number] | |
: match |
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
IF OBJECT_ID('[dbo].[Country]', 'U') IS NOT NULL | |
DROP TABLE [dbo].[Country] | |
CREATE TABLE [dbo].[Country] | |
( | |
Id int NOT NULL IDENTITY(1,1), | |
Name varchar(80) NOT NULL, | |
DisplayName varchar(80) NOT NULL, | |
Iso char(2) NOT NULL, | |
Iso3 char(3) NULL, |
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; | |
using System.Collections.Generic; | |
using System.IO;; | |
using System.Net; | |
using System.Xml.Serialization; | |
namespace ConsoleApplication1 | |
{ | |
class Program | |
{ |
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
<# | |
.SYNOPSIS | |
Automation of the steps described on https://dev.mysql.com/doc/mysql-windows-excerpt/5.7/en/resetting-permissions-windows.html | |
to reset the Root Password of MySql server on a Windows system. | |
.PARAMETER MysqlServiceName | |
The MySql service's name (e.g. MySQL56). | |
.PARAMETER RootPassword | |
The password for the root user | |
#> | |
Param( |
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; | |
using System.Diagnostics; | |
using System.Runtime.InteropServices; | |
using System.Windows.Input; | |
using static PInvoke.User32; | |
using static PInvoke.Kernel32; | |
namespace WpfApplication1 | |
{ |
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 file="ApplyVersionToAssemblies.ps1">(c) Microsoft Corporation. This source is subject to the Microsoft Permissive License. See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx. All other rights reserved.</copyright> | |
##----------------------------------------------------------------------- | |
# Look for a 0.0.0.0 pattern in the build number. | |
# If found use it to version the assemblies. | |
# | |
# For example, if the 'Build number format' build process parameter | |
# $(BuildDefinitionName)_$(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r) | |
# then your build numbers come out like this: | |
# "Build HelloWorld_2013.07.19.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
[CmdletBinding()] | |
param( | |
[switch]$force | |
) | |
$userProfileDir = $env:USERPROFILE | |
$NodeDir = Join-Path $userProfileDir "Node" | |
if($force -and (Test-Path $NodeDir)){ |
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
public class Odbccp32 | |
{ | |
/// <summary> | |
/// From sql.h | |
/// </summary> | |
private const int SQL_MAX_MESSAGE_LENGTH = 512; | |
[DllImport(nameof(Odbccp32), CharSet = CharSet.Unicode, SetLastError = true)] | |
[return: MarshalAs(UnmanagedType.Bool)] | |
public static extern bool SQLGetInstalledDrivers(char[] lpszBuf, ushort cbufMax, out ushort pcbBufOut); |
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
public class Odbccp32 | |
{ | |
/// <summary> | |
/// From sql.h | |
/// </summary> | |
private const int SQL_MAX_MESSAGE_LENGTH = 512; | |
[DllImport(nameof(Odbccp32), CharSet = CharSet.Unicode, SetLastError = true)] | |
[return: MarshalAs(UnmanagedType.Bool)] | |
public static extern bool SQLGetInstalledDrivers(char[] lpszBuf, ushort cbufMax, out ushort pcbBufOut); |
OlderNewer