https://www.newtonsoft.com/json/help/html/CreatingLINQtoJSON.htm
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
class AsyncMethods | |
{ | |
/// <param name="sleepTime">sleep time in seconds</param> | |
public async Task<bool> SleepAsync(int sleepTime) | |
{ | |
Console.WriteLine($"SleepAsync for {sleepTime} seconds starts"); | |
await Task.Delay(sleepTime*1000); | |
Console.WriteLine($"SleepAsync for {sleepTime} seconds completes"); | |
return true; | |
} |
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
static void Main(string[] args) | |
{ | |
//initialize an stopwatch | |
var sw = new Stopwatch(); | |
// run "TestAsyncMethods" | |
sw.Start(); | |
Execute().GetAwaiter().GetResult(); | |
sw.Stop(); | |
Console.WriteLine($"Done! Completed in {sw.Elapsed}"); |
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
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Huic ego, si negaret quicquam interesse ad beate vivendum quali uteretur victu, concederem, laudarem etiam; Hanc se tuus Epicurus omnino ignorare dicit quam aut qualem esse velint qui honestate summum bonum metiantur. Idem etiam dolorem saepe perpetiuntur, ne, si id non faciant, incidant in maiorem. Duo Reges: constructio interrete. <i>Cyrenaici quidem non recusant;</i> <a href="http://loripsum.net/" target="_blank">Id Sextilius factum negabat.</a> Velut ego nunc moveor. Illis videtur, qui illud non dubitant bonum dicere -; <i>Haec para/doca illi, nos admirabilia dicamus.</i> <mark>Eam tum adesse, cum dolor omnis absit;</mark> Callipho ad virtutem nihil adiunxit nisi voluptatem, Diodorus vacuitatem doloris. <a href="http://loripsum.net/" target="_blank">Nulla erit controversia.</a> </p> | |
<p>Quis est, qui non oderit libidinosam, protervam adolescentiam? De malis autem et bonis ab iis animalibus, quae nondum depravata sint, ait optime iudicari. <a href |
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.Linq; | |
using System.Net.Http; | |
using System.Security.Cryptography; | |
using System.Security.Cryptography.X509Certificates; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; |
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
var urlsFilePath = @"file.txt"; // file contains a tab separated filename/fileUrl combination on each line | |
var lines = File.ReadAllLines(urlsFilePath); | |
var outFileFolder = "images"; | |
var httpClient = new HttpClient(); | |
foreach (var line in lines) | |
{ | |
var fileName = line.Split('\t')[0]; |
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
netsh interface portproxy add v4tov4 listenport=80 listenaddress=127.65.43.21 connectport=31661 connectaddress=127.0.0.1 | |
netsh interface portproxy show v4tov4 | |
netsh interface portproxy delete v4tov4 listenport=80 listenaddress=127.65.43.21 | |
// append hosts file | |
127.65.43.21 <the domain name you want to debug> |
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
$role = [Microsoft.Azure.Commands.Resources.Models.Authorization.PSRoleDefinition]::new() | |
$role.Name = "Custom Role" | |
$role.IsCustom = $true | |
$role.Description = "Can perform assigned activities" | |
$perms = 'Microsoft.Compute/virtualMachines/read','Microsoft.Compute/virtualMachines/write' | |
$role.Actions = $perms | |
$role.assignableScopes = "/subscriptions/11111111-1111-1111-1111-111111111111" | |
New-AzRoleDefinition -Role $role |
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 SQL Server Express if not installed | |
// ensure SQL Server Express is running | |
// start cmd with Admin Priviledge | |
// navigate to C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator | |
cd C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator | |
// run | |
AzureStorageEmulator.exe init -server . -sqlinstance SQLEXPRESS -forcecreate |
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
function subscribe() { | |
var email = $("#emailId").val(); | |
$.ajax({ | |
url: "https://docs.google.com/forms/d/e/1FAIpQLSc8TP0eS1iPwap4dVM6IlEWtkw_kHfpmDedlLWc5lQ88_2xCw/formResponse?", | |
data: { "entry.1709137143": email}, // replace the numeric part of "entry.______" with the actual field name. more fields can be added in the data object | |
type: "POST", | |
success: function(d) {alert("thank you, you're subscribed to ngIndia 2020 updates")}, | |
error: function(d) {alert("oops! something went wrong, please try again.")} | |
}); |
OlderNewer