using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies
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
def has_cycle(head): | |
if head is None: | |
return False | |
begin = end = head | |
while (begin or end or end.next): | |
if end.next is None: | |
return False |
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" | |
"errors" | |
) | |
func getMax(arr []int) int { | |
var max int = 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
package main | |
import ( | |
"fmt" | |
"errors" | |
) | |
type Node struct { | |
value int32 | |
next *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
function main(input) { | |
var inputs=input.split(" "); | |
function comp(a,b){ | |
console.log("a, b : ", a, b) | |
var ab=a.concat(b); | |
var ba=b.concat(a); | |
console.log("ab, ba : ", ab, ba) | |
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
function main(input) { | |
//Enter your code here | |
inputs=input.split("\n"); | |
var t=parseInt(inputs[0]); | |
var i=1; | |
var j; | |
while(t--) | |
{ |
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
const http = require('http'); | |
const fs = require('fs'); | |
const path = require('path'); | |
const https = require("https"); | |
const querystring = require('querystring'); | |
const td = new Date("2018-09-01") | |
const config = { | |
"userId" : "HhjEtD0rD", | |
"endpoints" : { |
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
const http = require('http'), | |
stream = require('stream'), | |
AWS = require('aws-sdk'), | |
http = require('http'); | |
const uploadStream = ({ Bucket, Key }) => { | |
const s3 = new AWS.S3(); | |
const pass = new stream.PassThrough(); | |
return { | |
writeStream: pass, |
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
const { | |
MongoClient, ObjectId | |
} = require("mongodb"); | |
const { | |
Client | |
} = require('@elastic/elasticsearch'); | |
const Transform = require("stream").Transform; | |
const defaultElasticSettings = { |
OlderNewer