Skip to content

Instantly share code, notes, and snippets.

View pradeepsng30's full-sized avatar
:octocat:
gitting

Pradeep Singh pradeepsng30

:octocat:
gitting
View GitHub Profile

As programmers, we must configure Spring. Spring must know:

Where to start In this case, start with SpringApplication.run() Which classes the container must process In this case, use Annotations How to create instances of classes For Spring annotations, use @Component, @Service, @Bean, etc. For JSR330 annotations, use @Named

kill process at port 8000

kill -9 $(lsof -ti:8000) kill -9 $(lsof -ti:8000,8443)

kill all node processs

killall node

https://medium.com/@FloSloot/node-js-is-not-single-threaded-88928ada5838
If you were anything like me, you would’ve come here thinking:
What the heck is he talking about?! Of course Node.js is single threaded!
But that’s only partially true! Bare with me.
TL;DR
@pradeepsng30
pradeepsng30 / gitconfig.sh
Last active October 4, 2020 22:23
Multiple git accounts accounts
#In your ~/.gitconfig you can put something like this.
# git version > 2.13
# https://stackoverflow.com/questions/8801729/is-it-possible-to-have-different-git-config-for-different-projects/43884702#43884702
[includeIf "gitdir:~/company_a/"]
path = .gitconfig-company_a
[includeIf "gitdir:~/company_b/"]
path = .gitconfig-company_b
https://github.com/FreemanZhang/system-design
@pradeepsng30
pradeepsng30 / Peer dependency
Created April 6, 2019 09:32
npm dependencies
To make this a little more concrete, let’s look at a couple of examples. First off, let’s take a look at some simple cases, starting with some uses of ramda:
import { merge, add } from 'ramda'
export const withDefaultConfig = (config) =>
merge({ path: '.' }, config)
export const add5 = add(5)
The first example here is pretty obvious: in withDefaultConfig, merge is used purely as an implementation detail, so it’s safe, and it’s not part of the module’s interface. In add5, the example is a little trickier: the result of add(5) is a partially-applied function created by Ramda, so technically, a Ramda-created value is a part of this module’s interface. However, the contract add5 has with the outside world is simply that it is a JavaScript function that adds five to its argument, and it doesn’t depend on any Ramda-specific functionality, so ramda can safely be a non-peer dependency.
@pradeepsng30
pradeepsng30 / JS learnings.md
Last active March 30, 2021 07:21
JS learnings

JS learnings

things to note in JS while learning them. putting from my private notes to public gist.

TODO

  • hoisting
  • Scope of var
  • inheritence in es5
  • currying
  • setTimeout