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
cat *.csv| awk -F "\"*,\"*" '{print $2}'|uniq|wc -l |
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
./redis-cli -p 7777--raw keys "*" | xargs ./redis-cli -p 7777 del |
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
pm.models.user.find({}, (err, users) => { | |
users.forEach((user) => { | |
console.log(`User ID: ${user.id} \n Access Token: ${user.auth.access_token} \n Email: ${user.email}`); | |
}); | |
}); |
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
var fs = require('fs'), // needed to read JSON file from disk | |
sdk = require('postman-collection'), | |
Collection = sdk.Collection, | |
Request = sdk.Request, | |
Item = sdk.Item, | |
ItemGroup = sdk.ItemGroup, | |
_ = require('lodash'), | |
myCollection, | |
requests = [], | |
dfs = function (item, requests) { // fn -> Depth first search |
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
console.log(require('http').STATUS_CODES); |
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
// Fiddle - https://jsfiddle.net/ratpik/azf5a9bv/3/ | |
var UUIDIndex = {0:8, 1:4, 2:4, 3:4, 4:12}; | |
function isHex(h, index) { | |
if (UUIDIndex[index] !== _.size(h)) return false; | |
var a = parseInt(h, 16); | |
return !isNaN(a) && | |
a.toString(16) === _.toLower(h) || | |
_.join(_.times(_.size(h), _.constant(0)), '') === _.toLower(h); |
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
it.only('Async should work with Recursion', function (done) { | |
var n = 10; | |
var f = function(callback) { | |
async.waterfall([ | |
function (cb) { | |
n--; | |
cb(null, n); | |
}, | |
function (b, cb) { |
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
var MyString = function(source){ | |
var arr = []; | |
for(var index in source){ | |
arr.push(source[index]); | |
//Public property | |
this[index] = source[index]; | |
} | |
//Public property |
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
class Node: | |
def __init__(self, value): | |
self.value = value | |
self.left = None | |
self.right = None | |
class BST: | |
def __init__(self, root=None): |
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
class Node: | |
def __init__(self, key=None, word_count=0): | |
self.key = key | |
self.word_count = word_count #Since word and prefix counts are same | |
self.edges = [] #List of Nodes | |
class Trie: | |
def __init__(self, root=None): | |
self.root = root |