Skip to content

Instantly share code, notes, and snippets.

View rupeshtiwari's full-sized avatar
🎯
Focusing

Rupesh Tiwari rupeshtiwari

🎯
Focusing
View GitHub Profile
@rupeshtiwari
rupeshtiwari / how_to_return_promise.js
Last active August 6, 2018 18:21
In order to make your program reactive you need promise dataType. In below 2 examples I am explaining how to create promise object and return data or error message.
// getData function is pretending that it is fetching data and after 2 second it received data.
// $ is jQuery
function getData() {
//creating on dererred object
var deferred = $.Deferred();
// after 2 second resolve promise with data.
setTimeout(function() {
deferred.resolve([1,2,3]);
}, 2000);
@rupeshtiwari
rupeshtiwari / function-hoisiting.js
Last active August 13, 2018 18:05
JavaScript Concepts
log();
var log = function(msg) {
alert(msg);
}
/*
* in this case log function is a expression type and log varibale will be hoisted at the top
* and initialized with undefined therefore, we will get
* Uncaught TypeError: log is not a function
*/
@rupeshtiwari
rupeshtiwari / Working With Git.md
Last active June 19, 2019 19:10
Working with Git

For deleting the remote branch:

git push origin --delete <your_branch>

Override current file with server file

git checkout --theirs package-lock.json

@rupeshtiwari
rupeshtiwari / Desktop or Machine Setup From Scratch for MEAN.md
Last active May 21, 2020 17:58
FullStack developer environment setup Desktop or Machine Setup From Scratch for MEAN

Setting up an box for Full Stack Developer Guide and Tutorial

FullStack developer environment

Install below softwares for Windows Desktop/Laptop

Note: Run all software as administrator.

@rupeshtiwari
rupeshtiwari / VS Code Extensions For Professional MEAN Stack Development.md
Last active July 9, 2020 19:52
VS Code Extensions For Professional MEAN Stack Development

Install below VsCode Extensions

  • Peacock
  • Angular Language Service
  • ESLint
  • GitLens — Git supercharged
  • Material Icon Theme
  • Prettier - Code formatter
  • Markdown All in One
  • npm (npm support for vscode)
@rupeshtiwari
rupeshtiwari / 100-RxJS Subjects Demystified.md
Last active September 16, 2020 14:34
RxJS Subjects Demystified

Understanding RxJS BehaviorSubject, ReplaySubject and AsyncSubject

What are RxJS subjects and the benefits of using them. How to understand RxJS subjects such that you can apply it in your day to day coding at your own project. Well lets get started.

There are 4 types of RxJS Subjects:

  1. Subject
  2. BehaviorSubject
  3. ReplaySubject
  4. AsyncSubject
@jamstooks
jamstooks / cloud9.md
Last active May 30, 2023 06:17
Notes on starting up an AWS Cloud9 Django dev environment with Python3

My AWS Cloud9 Setup for Python/Django and Node

Getting setup

sudo yum -y update

I'm not a big fan of their default bash prompt:

echo "export PS1='[\D{%F %T}]\n\[\e]0;\w\a\]\[\e[32m\]\u:\[\e[33m\]\w\[\e[0m\]\n\$ '" >> ~/.bashrc

source ~/.bashrc

@rupeshtiwari
rupeshtiwari / list.txt
Last active July 5, 2023 23:39 — forked from shortjared/list.txt
List of AWS Service Principals
a4b.amazonaws.com
access-analyzer.amazonaws.com
account.amazonaws.com
acm-pca.amazonaws.com
acm.amazonaws.com
airflow-env.amazonaws.com
airflow.amazonaws.com
alexa-appkit.amazon.com
alexa-connectedhome.amazon.com
amazonmq.amazonaws.com
@remojansen
remojansen / class_decorator.ts
Last active September 14, 2023 14:54
TypeScript Decorators Examples
function logClass(target: any) {
// save a reference to the original constructor
var original = target;
// a utility function to generate instances of a class
function construct(constructor, args) {
var c : any = function () {
return constructor.apply(this, args);
}
@rupeshtiwari
rupeshtiwari / attach extra volume to EC2.md
Last active September 26, 2023 17:34
attach extra volume to EC2, AWS, Linux, Storage, Mounting Amazon EBS to EC2 Instance, extra volume, attach ebs, aws

Mounting Amazon EFS to EC2 Instance, extra volume, attach ebs, aws

  1. Create new extra EBS volume from AWS console named /dev/xvdf
  2. Attach the new volume to EC2 from AWS Console
  3. Connect to EC2, create a new directory and mount the new extra EBS volume
  • Check all devices attached sudo lsblk -f

  • Determine if file system exist for the new volume sudo file -s /dev/xvdf

  • Create a new file system on EC2 to mount volume mkfs -t xfs /dev/xvdf

    image