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
version: "3.0" | |
services: | |
elasticsearch: | |
container_name: es-container | |
image: docker.elastic.co/elasticsearch/elasticsearch:6.7.1 | |
#6.4.3 | |
#8.3.2 | |
#7.3.0 | |
#6.4.3 | |
environment: |
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
version: "3" | |
services: | |
zookeeper: | |
image: 'bitnami/zookeeper:latest' | |
ports: | |
- '2181:2181' | |
environment: | |
- ALLOW_ANONYMOUS_LOGIN=yes |
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://pynative.com/python-convert-json-data-into-custom-python-object/#:~:text=To%20convert%20JSON%20into%20a,into%20a%20custom%20Python%20type. | |
#https://www.geeksforgeeks.org/encoding-and-decoding-custom-objects-in-python-json/ | |
import json | |
from json import JSONEncoder | |
from collections import namedtuple | |
class Student: | |
def __init__(self, name, roll_no, address): | |
self.name = name | |
self.roll_no = roll_no | |
self.address = address |
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
#Sort by the fields comparator | |
student_tuples = [ | |
('john', 'A', 15), | |
('jane', 'B', 12), | |
('dave', 'B', 10), | |
] | |
sorted(student_tuples, key=lambda student: student[2]) # sort by age | |
[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)] |
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
#Connect to pod | |
kubectl exec --stdin --tty shell-demo-pod -- /bin/bash | |
#for alpine image | |
kubectl exec --stdin --tty shell-demo-pod -- /bin/sh | |
#PING the kubernetes service | |
>nslookup "endpoint service ip" | |
#MOngo commands | |
#switch to collection |
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
Important and Useful links from all over the Leetcode | |
Link:https://leetcode.com/discuss/general-discussion/665604/important-and-useful-links-from-all-over-the-leetcode | |
By deepika135 | |
Most of the time I want to comeback to a particular post on Leetcode and so I have to bookmark different posts a lot of times. This has led to an increase to the number of my bookmarks a lot. Since there is no option to bookmark your favourite articles on Leetcode, I have been trying to compile a list of all Leetcode's important and useful links. Here is the list I have made till now. Posting it here so as to help the LC community as well. Do let me know the useful and important articles that I have missed. Will add them to this list. This way we all won't have to bookmark many posts on Leetcode and instead just bookmark this post alone. | |
Hope this helps - | |
I am trying to compile all the good posts on Leetcode. Comment down whichever I am missing and I will add all of them here - | |
DP for beginners by @wh0ami - https://leetcode.co |
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
/* | |
take 1 2 3 4------1thousand two hundread thitry four | |
limit 10 lakh | |
*/ | |
public class NumberToWord{ | |
public String numLetters(char ch){ | |
if(ch=='1'){ | |
return "one"; |
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://www.interviewbit.com/problems/combination-sum/ | |
public class Solution { | |
public ArrayList<ArrayList<Integer>> combinationSum(ArrayList<Integer> A, int B) { | |
ArrayList<ArrayList<Integer>> big=new ArrayList<ArrayList<Integer>>(); | |
if(A.size()==0){ | |
return big; | |
} | |
Collections.sort(A); | |
combination(big,0,A,B,new ArrayList<Integer>(),B); | |
Collections.sort(big,new Comparator<ArrayList<Integer>>(){ |
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
gocov test ./... | gocov-xml > coverage.xml | |
https://github.com/AlekSi/gocov-xml | |
go get github.com/axw/gocov/gocov | |
go test workspace/... --coverprofile=coverage.txt | |
gocov convert coverage.txt > coverage.json | |
gocov-xml < coverage.json > coverage.xml | |
#Go coverage | |
https://github.com/ory/go-acc |
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
package main | |
import ( | |
"fmt" | |
"encoding/json" | |
) | |
type ProjectAttributes struct{ | |
ProjectId string | |
Attributes map[string]interface{} | |
} |
NewerOlder