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
# Colors definition | |
BLUE='\e[94m' | |
L_BLUE='\e[96m' | |
YELLOW='\e[93m' | |
GREEN='\e[32m' | |
L_GREEN='\e[92m' | |
RED='\e[31m' | |
L_RED='\e[91m' | |
NC='\e[0m' |
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
#!/bin/bash | |
#################################### | |
# | |
# Open all required porjects. | |
# | |
#################################### | |
gnome-terminal --tab --command="bash -c 'cd /path/to/your/project/angular-project-1; npm start; $SHELL'" \ | |
--tab --command="bash -c 'cd /path/to/your/project/angular-project-2; ng serve -p 4201; $SHELL'" \ | |
--tab --command="bash -c 'cd /path/to/your/project/angular-project-3; ng serve -p 4202; $SHELL'" |
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
class Solution: | |
def isValid(self, s: str) -> bool: | |
s = s.replace(' ','') | |
if len(s)%2 != 0: | |
return False | |
dict = {'(' : ')', '[' : ']', '{' : '}'} | |
ar = [] | |
for i in s: | |
if i in dict: | |
ar.append(i) |
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
class Solution: | |
def longestCommonPrefix(self, strs: List[str]) -> str: | |
if len(strs) == 0: | |
return "" | |
common_prefix = strs[0] | |
for i in range(1,len(strs)): | |
temp = "" | |
if len(common_prefix) == 0: | |
break | |
for j in range(len(strs[i])): |
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
class Solution: | |
def romanToInt(self, s: str) -> int: | |
roman_dict = { 'I':1, 'V':5, 'X':10, 'L':50, 'C':100, 'D':500, 'M':1000, 'IV':4, 'IX':9, 'XL':40, 'XC':90, 'CD':400, 'CM':900 } | |
i = 0 | |
sum = 0 | |
while i < len(s): | |
if s[i:i+2] in roman_dict and i+1<len(s): | |
sum+=roman_dict[s[i:i+2]] | |
i+=2 | |
else: |
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
# @param {Integer[]} nums | |
# @param {Integer} k | |
# @return {Void} Do not return anything, modify nums in-place instead. | |
def rotate(nums, k) | |
count = 0 | |
start = 0 | |
while (count < nums.size) | |
current = start | |
prev = nums[start] | |
loop do |
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
class Solution { | |
/** | |
* @param Integer[] $nums | |
* @param Integer $k | |
* @return NULL | |
*/ | |
function rotate(&$nums, $k) { | |
$count = 0; | |
$start = 0; |
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
class Solution: | |
def rotate(self, nums: List[int], k: int) -> None: | |
""" | |
Do not return anything, modify nums in-place instead. | |
""" | |
count = 0 | |
start = 0 | |
while (count < len(nums)): | |
current = start | |
prev = nums[start] |
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
# This will print you PID of process bound on that port. | |
fuser 3000/tcp | |
# And this will kill that process | |
fuser -k 3000/tcp |
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
$("input:empty").length == 0; | |
/* Above statement will bypass the empty spaces. */ | |
/* If you want to search for all empty inputs including blank/empty spaces. Try below one */ | |
$("input").filter(function () { | |
return $.trim($(this).val()).length == 0 | |
}).length == 0; |
NewerOlder