Skip to content

Instantly share code, notes, and snippets.

View pajaydev's full-sized avatar

Ajaykumar pajaydev

View GitHub Profile
@pajaydev
pajaydev / export-dynamodb-table.py
Last active December 7, 2023 23:15
Script to export Dynamodb records from old table and migrate those records to new dynamodb table.
import boto3
import json
SOURCE_TABLE_NAME = "--replace-source-tablename--"
DESTINATION_TABLE_NAME = "--replace-destination-tablename--"
# export records in tableName.json file
OUTPUT_FILE = f"{SOURCE_TABLE}.json"
# replace region
AWS_REGION = "us-west-2"
failed_updates = []
@pajaydev
pajaydev / https.md
Created February 3, 2021 04:19
Use HTTPS for local development using node/express js

Using HTTPS for local development using node/express js

Installation:

  1. Install brew (package manager for mac os)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
  1. Install mkcert[https://github.com/FiloSottile/mkcert] a. For mac
brew install mkcert
@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 / curl.sh
Created May 21, 2020 05:07
Curl commands
curl https://www.ebay.com --header "Accept-Language: es"
curl https://www.ebay.com --silent | grep JavaScript
@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"});
@pajaydev
pajaydev / snippets.js
Last active September 8, 2020 17:56
JS Snippets
// use reduce function to find sum of all elements in array
const array = [1,2,3,4,5];
const sumValue = array.reduce((sum, value)=> sum + value, 0); // 15
// check all the children is valid or not.
root.children.every(child => !child)
// filtering the values in JSON.stringify.
@pajaydev
pajaydev / gist:c4023b0d998943ca0341b368b47ee97e
Created February 17, 2020 22:56 — forked from rxaviers/gist:7360908
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:
@pajaydev
pajaydev / docker-commands.sh
Last active November 26, 2019 07:54
Handy Docker Commands
###################################################################
###################### DOCKER #################################
###################################################################
# check docker is installed in your system by typing docker
$ docker
###################### IMAGES #################################
# To check all exisiting docker images
$ docker images
/* Big tablet to 1200px */
@media only screen and (max-width: 1200px) {
}
/* Small tablet to big tablet: from 768px to 1023px */
@media only screen and (max-width: 1023px) {
}