Skip to content

Instantly share code, notes, and snippets.

View pajaydev's full-sized avatar

Ajaykumar pajaydev

View GitHub Profile
@pajaydev
pajaydev / js-protect-objects.md
Last active September 22, 2020 20:52
Make the object immutable in JS - Object.seal() vs Object.freeze() vs Object.preventExtensions()

Object.seal vs Object.freeze vs Object.preventExtensions()

Object.seal()

/**
 * The Object.seal() method seals an object: that is, prevents new properties to be getting added and making all existing properties
 * non-configurable.
 *
 * @Reference:
 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/seal
 */
@pajaydev
pajaydev / index.html
Last active June 4, 2020 07:26
Consume ebay node api using Express JS
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<title>Ebay node api demo</title>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<link rel='stylesheet' type='text/css' media='screen' href='main.css'>
<script src='main.js'></script>
</head>
@pajaydev
pajaydev / js-objects-compare.md
Last active April 5, 2024 01:47
JS Objects : Object.keys vs for..in vs getOwnPropertyNames vs Object.entries

Object.keys vs for..in vs getOwnPropertyNames vs Object.entries

const language = {
  name: 'JavaScript',
  author: 'Brendan Eich'
};

// Inheriting from another object.
Object.setPrototypeOf(language, {createdAt: "Netscape"});
@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active May 16, 2024 13:16
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest
@rxaviers
rxaviers / gist:7360908
Last active May 23, 2024 23:28
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@adamwdraper
adamwdraper / Node.js File Looper
Created December 5, 2012 04:46
Loop through all files in a given directory with node.js
var fs = require('fs');
var walkPath = './';
var walk = function (dir, done) {
fs.readdir(dir, function (error, list) {
if (error) {
return done(error);
}
@chitchcock
chitchcock / 20111011_SteveYeggeGooglePlatformRant.md
Created October 12, 2011 15:53
Stevey's Google Platforms Rant

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real