Skip to content

Instantly share code, notes, and snippets.

View PrateekKumarSingh's full-sized avatar

Prateek Singh PrateekKumarSingh

View GitHub Profile
# optionally clone the project from github
git clone https://github.com/PrateekKumarSingh/AzViz.git
Set-Location .\AzViz\
# import the powershell module
Import-Module .\AzViz.psm1 -Verbose
# login to azure, this is required for module to work
Connect-AzAccount
#!/usr/bin/python
import os
# YouTube video searching API
from apiclient.discovery import build
from apiclient.errors import HttpError
from oauth2client.tools import argparser
# Downloading YouTube videos
import pafy
# value type variable
$valueVar = 0
# reference type variable
$referenceVar = [ref]0
function increment {
$valueVar++ # increment value type variable
$referenceVar.Value++ # increment reference type variable
}
class Book
{
public string Name = "";
public string Author = "";
}
Book X = new Book();
X.Name = "Harry Potter";
X.Author = "J. K. Rowling";
int x = 5;
// value type variables copies the value
int y = x;
// changing the value of 'y' doesn't change the value of 'x'
y = 3;
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
url = "https://keytodatascience.com/games"
browser = webdriver.Chrome()
def capture_matrix():
h = {}
for i in range(0,25):
element = browser.find_element_by_id(i)
using System.Management.Automation;
namespace ReadSecurely
{
class Program
{
static void Main(string[] args)
{
// this doesn't works
PowerShell ps = PowerShell.Create();
var pass = ps.AddCommand("Read-Host").AddParameter("AsSecureString").Invoke();
using System;
using System.Management.Automation;
namespace app {
class Program {
static void Main(string[] args) {
Console.Write ("Enter your password: ");
var password = string.Empty;
ConsoleKey key;
do {
using System;
namespace app
{
public class Program
{
public static void Main()
{
Console.WriteLine("Hello World!");
}
}