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
//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
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
/* | |
* 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
// 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
//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
/** | |
* Definition for singly-linked list. | |
* public class ListNode { | |
* public int val; | |
* public ListNode next; | |
* public ListNode(int x) { val = x; } | |
* } | |
*/ | |
public class Solution { | |
public void PrintNode(ListNode node) |
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; | |
namespace LongestSubstring | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
string input = "abrkaabcdefghijjxxx"; |
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
public class Solution { | |
private int compx; | |
public int MinDepth(TreeNode root) { | |
compx = 0; | |
if (root is null) | |
return 0; | |
Queue queue = new Queue(); |
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
npm version | |
npm config get msvs_version | |
npm config get msvs_version --global | |
npm config set msvs_version 2013 | |
npm config set msvs_version 2013 --global | |
npm i -g npm@latest //Update to the latest version | |
npm run build //refresh typescript |