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
//https://leetcode.com/problems/find-all-duplicates-in-an-array/ | |
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
public class Solution { | |
public IList<int> FindDuplicates(int[] nums) { | |
if (nums is null) |
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
// Solved problem: https://leetcode.com/problems/reverse-linked-list/ | |
/** | |
* Definition for singly-linked list. | |
* struct ListNode { | |
* int val; | |
* ListNode *next; | |
* ListNode(int x) : val(x), next(NULL) {} | |
* }; | |
*/ |
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
/* | |
* Simple debug example in Node JS :) | |
* | |
*/ | |
// 1. Install debug in the folder where your app lives | |
// npm install debug --save | |
// 2. Copy and paste this line to your js file to your dependencies, then use debug('My comments'); in your code | |
// var debug = require('debug')('my_debug_name'); |
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.Diagnostics; | |
namespace ReadDLLVersion | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Console.WriteLine(FileVersionInfo.GetVersionInfo(@"C:\SomeDLL.dll").FileVersion); |
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
//From: https://www.youtube.com/watch?v=s6SH72uAn3Q | |
{ //Declare scope | |
let cleanRoom = function(message) { | |
return new Promise(function(resolve, reject) { | |
resolve(message + ' I cleaned the room!'); | |
}); | |
}; |
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
//Based on: https://www.youtube.com/watch?v=s6SH72uAn3Q | |
let promiseToCleanRoom = new Promise(function(resolve, reject) { | |
//cleaning the room | |
let isClean = false; | |
if (isClean) | |
resolve('Clean'); | |
else | |
reject('Dirty'); |
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
_some_handler.post = function(data, callback){ | |
var reqDetails = {}; //Some details | |
var reqData = {}; //Some data | |
var req = https.request(reqDetails, function(res){ | |
if(200 == res.statusCode) { | |
callback(200, {'Message' : 'Success'}); | |
} else { |
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.IO; | |
using System.Linq; | |
using System.Text.RegularExpressions; | |
namespace UpgradeFrameworkInProjects | |
{ | |
class Program | |
{ | |
private const string exitCode = "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
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
namespace RemoveFolders | |
{ | |
class Program | |
{ | |
private const string exitCode = "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
using System; | |
using Newtonsoft.Json; | |
using Newtonsoft.Json.Linq; | |
namespace DuplicatedJsonProperties | |
{ | |
class DuplicatedJsonProperties | |
{ | |
private const string data = | |
@"{ |