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 display all tables in a database. | |
select TABLE_NAME | |
from YourDatabase.INFORMATION_SCHEMA.TABLES | |
where TABLE_TYPE = 'BASE TABLE' |
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 get a list of databases. | |
select name from sys.databases; |
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 to show component border together with component name. It is useful for AngularJS component-based application design. | |
*/ | |
(function () { | |
'use strict'; | |
var app = angular.module('app'); | |
app.run(function () { |
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
/* | |
A function to verify Google reCAPTCHA (server side integration) | |
*/ | |
protected bool VerifyRecaptcha() | |
{ | |
var values = new Dictionary<string, string> | |
{ | |
{ "secret", ConfigurationManager.AppSettings["recaptcha:SecretKey"] }, | |
{ "response", HttpContext.Request["g-recaptcha-response"] }, | |
{ "remoteip", HttpContext.Request.UserHostAddress }, |
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); |
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
{ | |
// 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
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
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
-- To view content of a stored proc | |
-- Option 1 | |
exec sp_helptext 'dbo.NameOfTheSp' | |
-- Option 2 | |
select OBJECT_DEFINITION(OBJECT_ID('NameOfTheSp')) |
OlderNewer