Skip to content

Instantly share code, notes, and snippets.

View tharun208's full-sized avatar
🎯
Trying to be an OSS contributor

Tharun Rajendran tharun208

🎯
Trying to be an OSS contributor
View GitHub Profile
@tharun208
tharun208 / client.test.js
Created March 5, 2021 20:14
Axios mocking using jest
const axios = require("axios");
const { fetchData } = require("./server");
jest.mock("axios");
const mockServerErrorResponse = {
response: {
status: 500,
data: "system error",
},
@tharun208
tharun208 / cockroach-after.bash
Created March 1, 2021 10:19
cockroach-after
Start a CockroachDB node, which will export data from one or more
storage devices, specified via --store flags.
Specify the --join flag to point to another node or nodes that are
part of the same cluster. The other nodes do not need to be started
yet, and if the address of the other nodes to be added are not yet
known it is legal for the first node to join itself.
To initialize the cluster, use 'cockroach init'.
@tharun208
tharun208 / cockroach-start-before.bash
Last active March 1, 2021 10:16
cockroach-start-before
Start a CockroachDB node, which will export data from one or more
storage devices, specified via --store flags.
Specify the --join flag to point to another node or nodes that are
part of the same cluster. The other nodes do not need to be started
yet, and if the address of the other nodes to be added are not yet
known it is legal for the first node to join itself.
To initialize the cluster, use 'cockroach init'.
// +build name
package name
func PrintName() string {
return "My Name is Gopher"
}

Keybase proof

I hereby claim:

  • I am tharun208 on github.
  • I am tharun208 (https://keybase.io/tharun208) on keybase.
  • I have a public key ASC8HxaQoVb8vk_zy-3Igp0fRv0bu1a7AvHUnVhA46wC9Qo

To claim this, I am signing this object:

@tharun208
tharun208 / test.js
Created March 19, 2018 17:57
function to get Average and another to return object sorted on based on ranking
function getAverage(object)
{
for (const index of object) {
sum+=index.ranking;
}
return sum/object.length;
}
function sortBasedOnRanking(object)
{