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 System.Security.Cryptography; | |
using System.Text; | |
namespace PasswordHasher | |
{ | |
internal class Program | |
{ | |
static void Main(string[] args) | |
{ | |
const int keySize = 64; |
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
/* | |
To parse value from a dynamic object. | |
*/ | |
public T Parse<T>(dynamic value, string name) | |
{ | |
if (CheckProperty(value, name)) | |
{ | |
var parts = name.Split("."); |
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
-- Create table variable | |
declare @Temp as table | |
( | |
ID int not null primary key, | |
Data xml not null | |
) | |
-- Populate date into table variable | |
insert into @Temp (ID, Data) | |
select 1, '<Root xmlns:ns1="http://www.ns1.com/2010/1"> |
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
-- To find all objects in SQL Server schema | |
select * from sys.objects | |
where schema_id = SCHEMA_ID('dbo'); |
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
-- To view content of a stored proc | |
-- Option 1 | |
exec sp_helptext 'dbo.NameOfTheSp' | |
-- Option 2 | |
select OBJECT_DEFINITION(OBJECT_ID('NameOfTheSp')) |
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
rem To show which AD groups this account belongs to | |
net user /domain "username" |
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
rem To create file through the command line. | |
rem Press Ctrl+Z to create file. | |
rem Press Ctrl-C to cancel. | |
copy con myfile.txt |
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
{ | |
// See https://go.microsoft.com/fwlink/?LinkId=733558 | |
// for the documentation about the tasks.json format | |
"version": "2.0.0", | |
"tasks": [ | |
{ | |
"type": "shell", | |
"label": "gcc.exe build active file", | |
"command": "C:\\mingw-w64\\x86_64-8.1.0-posix-seh-rt_v6-rev0\\mingw64\\bin\\gcc.exe", | |
"args": [ |
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
#include<stdio.h> | |
int main() | |
{ | |
int apples; | |
int oranges; | |
int bananas; | |
printf("apples=%d oranges=%d bananas=%d", apples, oranges, bananas); |
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
public static class UrlHelperExtensions | |
{ | |
public static string GenerateAbsoluteUrl(this UrlHelper helper, string path, bool forceHttps = false) | |
{ | |
const string HTTPS = "https"; | |
var uri = helper.RequestContext.HttpContext.Request.Url; | |
var scheme = forceHttps ? HTTPS : uri.Scheme; | |
var host = uri.Host; | |
var port = (forceHttps || uri.Scheme == HTTPS) ? string.Empty : (uri.Port == 80 ? string.Empty : ":" + uri.Port); |
NewerOlder