Skip to content

Instantly share code, notes, and snippets.

@delwar2016
delwar2016 / git-common-command.md
Last active June 17, 2021 12:25
Git common command ...
  1. For creating new branch

git checkout -b [new-branch-name]

Example: we want to create new branch named: new-branch-1

git checkout -b new-branch-1

  1. For swicthing existing branch
@delwar2016
delwar2016 / mongodbUpdateQuery
Created September 29, 2016 05:34
mongodb update document
Suppose we have the following document in users_exams collection:
{
"answers" : [
{
"auto_score" : 0,
"question_id" : "579733a97e6b58a0616b2c55",
"user_answers" : "na",
"isCorrect" : false,
@delwar2016
delwar2016 / connect-vps-server.md
Created November 9, 2016 10:57
How to connect vps server

server ip: server-ip password: password user: root

using SSh command: -> ssh root@server-ip then it will asked for password like bellow root@server-ip's password: write password and press enter

How to install mobx in create-react-app
1) Run create-react-app.
2) Run npm run eject.
3) Run npm install --saveDev babel-plugin-transform-decorators-legacy.
4) Open package.json, find the "babel" section (line 78 for me), and add 4 lines so it looks like this:
Let’s create a new virtual envirnoment, named myenv, using pyvenv:
pyvenv myenv3
source myenv3/bin/activate
and you can start Python 3 by just typing:
$ python
Note that as you are inside the virtual environment, you don’t need to use the command python3 to open Python 3.
@delwar2016
delwar2016 / .Net Core Installation
Created November 18, 2016 09:52
.Net Core Installation
Link:
https://www.microsoft.com/net/core#macos
@delwar2016
delwar2016 / Set default node version with NVM
Last active November 25, 2016 06:00
Set default node version with NVM
# To Show installed versions
nvm ls
# Set 6.1.0 (or another version) as default
nvm alias default 6.1.0
@delwar2016
delwar2016 / Explain Python's slice notation
Last active January 10, 2017 01:59
Explain Python's slice notation
array[start:end:step] # start through not past end, by step
start: the beginning index of the slice, it will include the element at this index unless it is the same as end, defaults to 0, i.e. the first index.
If it's negative, it means to start n items from the end.
end: the ending index of the slice, it does not include the element at this index,
defaults to length of the sequence being sliced, that is, up to and including the end.
step: the amount by which the index increases, defaults to 1. If it's negative, you're slicing over the iterable in reverse.
@delwar2016
delwar2016 / Explain NumPy array object
Last active February 13, 2017 15:57
Explain NumPy array object
import numpy as np
# Manual construction of arrays
# one dimension array
a = np.array([0,1,2,3])
print(a)
print ('dimension', a.ndim)
@delwar2016
delwar2016 / How to stub jQuery remove using sinonJS
Created January 16, 2017 13:35
How to stub jQuery remove using sinonJS
Suppose we have following situation
$('#dom1').remove();
$('#dom2').remove();
$('#dom3').remove();
$('#dom4').remove();
So, we can write unit test as follows:
this.removeStub = sinon.stub($.fn, 'remove');
it('Should remove dom', function(){