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
-- Drop the ref.dates table if it already exists. | |
IF OBJECT_ID('ref.dates') IS NOT NULL DROP TABLE ref.dates; | |
GO | |
-- Create a temp table with computed values. We will delete this | |
-- temp table at the end of this script. | |
CREATE TABLE #dates ( | |
date DATE NOT NULL, | |
year AS DATEPART(YEAR, 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
/* | |
fn_FilenameFromFullPath.sql (c) 2017 Jarrett Meyer | |
Description: | |
Extracts a filename from a full path. Files may have spaces. | |
Examples: | |
dbo.fn_FilenameFromFullPath('file.txt') -> 'file.txt' | |
dbo.fn_FilenameFromFullPath('C:\file.txt') -> 'file.txt' | |
dbo.fn_FilenameFromFullPath('C:\temp\examples\file.txt') -> 'file.txt' |
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.Net; | |
using System.Net.Security; | |
using System.Security.Cryptography.X509Certificates; | |
namespace ServerCertificateValidationDemo | |
{ | |
public class Program | |
{ | |
private static string _defaultUrl = @"https://www.google.com"; |
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].[DecryptString] | |
( | |
@xml xml | |
) | |
returns varchar(max) | |
as | |
begin | |
declare @returnString varchar(max); | |
declare @temp table (line int, encryptedText varbinary(max), plainText varchar(max)); |
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 NHibernateSessionManager | |
{ | |
private const string CONNECTION_STRING_NAME = "..."; | |
private static Configuration configuration; | |
private static readonly ILog log; | |
private static ISessionFactory sessionFactory; | |
static NHibernateSessionManager() | |
{ |
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
# Install prerequisites. | |
sudo apt-get install -y build-essential \ | |
libreadline6 libreadline6-dev \ | |
gfortran \ | |
libxorg-dev \ | |
libbz2-dev \ | |
liblzma-dev \ | |
libpcre3-dev \ | |
libcurl4-openssl-dev \ | |
libjpeg-dev libtiff5-dev libicu-dev libcairo2-dev \ |
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
'use strict'; | |
const args = process.argv; | |
const cluster = require('cluster'); | |
function getThreads() { | |
let threads = 1; | |
let tag = args.indexOf('--threads'); | |
if (tag > 0) { | |
let newThreads = parseInt(args[tag + 1], 10); |
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
#!/usr/bin/env node | |
// | |
// Example of publisher/subscriber pattern in NodeJS, with AMQPLib. This program has been | |
// demonstrated to work with 500k messages and 4 subscribers. | |
// | |
// #WorksOnMyMachine | |
// | |
// Usage: ./pubsub | |
// |
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 abstract class HttpSession : IHttpSession | |
{ | |
protected IKeyValueStore storage; | |
public virtual int UserId | |
{ | |
get { return Get<int>("user_id"); } | |
set { storage["user_id"] = value; } | |
} | |
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
PATH | |
%WINDOWS_PATH%;%SQL_SERVER_PATH%;%VISUAL_STUDIO_PATH%;%GIT_PATH%;%NODEJS_PATH%;%DEVTOOLS_PATH% | |
WINDOWS_PATH | |
C:\Windows;C:\Windows\system32;C:\Windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\ | |
SQL_SERVER_PATH | |
C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio\ |