Skip to content

Instantly share code, notes, and snippets.

View imvikaskohli's full-sized avatar

VIKAS KOHLI imvikaskohli

  • Pune, India
View GitHub Profile
@imvikaskohli
imvikaskohli / difference.js
Created August 13, 2020 11:40 — forked from Yimiprod/difference.js
Deep diff between two object, using lodash
/**
* Deep diff between two object, using lodash
* @param {Object} object Object compared
* @param {Object} base Object to compare with
* @return {Object} Return a new object who represent the diff
*/
function difference(object, base) {
function changes(object, base) {
return _.transform(object, function(result, value, key) {
if (!_.isEqual(value, base[key])) {
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master
@imvikaskohli
imvikaskohli / simple-nodejs-iv-encrypt-decrypt.js
Created April 17, 2017 11:39 — forked from yoavniran/simple-nodejs-iv-encrypt-decrypt.js
nodejs crypto - simple encrypt & decrypt using IV (Initialization Vector)
"use strict";
var crypto = require("crypto");
var EncryptionHelper = (function () {
function getKeyAndIV(key, callback) {
crypto.pseudoRandomBytes(16, function (err, ivBuffer) {
var keyBuffer = (key instanceof Buffer) ? key : new Buffer(key) ;
@imvikaskohli
imvikaskohli / gist:963e7424e12af40c5d5ce0576d14fb3f
Created February 2, 2017 11:54
JavaScript: Sorting and filtering data with AngularJS
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>AngularJS Sorting &amp; Filtering Example</title>
<style type="text/css">
body{ font:12px arial, sans-serif; line-height:1.6em; margin:0 auto; max-width:960px; }
@imvikaskohli
imvikaskohli / Common-Currency.json
Created January 30, 2017 11:14 — forked from ksafranski/Common-Currency.json
Common Currency Codes in JSON
{
"USD": {
"symbol": "$",
"name": "US Dollar",
"symbol_native": "$",
"decimal_digits": 2,
"rounding": 0,
"code": "USD",
"name_plural": "US dollars"
},