- Check which global packages are outdated with:
npm outdated -g
For example:
- Update the pacakges:
# Idea from: https://machinelearningmastery.com/setup-python-environment-machine-learning-deep-learning-anaconda/ | |
# scipy | |
import scipy | |
print('scipy: %s' % scipy.__version__) | |
# numpy | |
import numpy | |
print('numpy: %s' % numpy.__version__) | |
# matplotlib | |
import matplotlib |
#!/bin/sh | |
cloc --fullpath --not-match-d='(node_modules|build|static|coverage|__tests__|tests)' --exclude-list-file=notcount . |
from multiprocessing import Pool | |
import redis | |
import math | |
import json | |
from random import seed | |
from random import gauss | |
# Atomic operations | |
def sum(x): | |
r = redis.Redis(host='localhost', port=6379, db=0) |
Let's assume the database is named "production" in your mongodb atlas cluster. First we do a dump:
mongodump --uri="mongodb+srv://<username>:<password>@<subdomain>.mongodb.net/production" --archive="mongodump-production"
Make sure you fill in the correct:
cd /etc/nginx/sites-enabled
ls
for checkingsudo rm site-to-be-removed
sudo nginx -t
, and if OKsudo service nginx reload
# Transforming a 60000x784 dataframe to a 60000x28x28x1 4D tensor for Keras modelling | |
train_img = X_train.values.reshape(X_train.shape[0], 28, 28, 1) |
import { Controller, Post, Body, Get, UseInterceptors, UploadedFile } from '@nestjs/common'; | |
import { CreateWebsiteDto } from './dto/create-website.dto'; | |
import { FileInterceptor } from '@nestjs/platform-express'; | |
import {existsSync, mkdirSync, writeFileSync} from 'fs'; | |
import { randomBytes } from 'crypto'; | |
import { join } from 'path'; | |
import { copySync } from 'fs-extra'; | |
import { exec, pwd } from 'shelljs'; | |
import * as rimraf from 'rimraf'; |
Using the library importlab and grep on a shell prompt from the project's root folder:
importlab --tree path/to/file.py | grep -E '^\s+[^::]*py$'