Skip to content

Instantly share code, notes, and snippets.

View myas92's full-sized avatar

Mohammad Yaser Ahmadi myas92

View GitHub Profile

Multiple commands and nested commands in yargs

network publish add [options]
network publish delete [options]

network internet add[options]
@myas92
myas92 / Git.md
Last active April 24, 2022 13:19

Git

don't use username and password

based on this tutoral : link

git config --global credential.helper 'cache --timeout 7200'
stages: # List of stages for jobs, and their order of execution
- build
- test
- deploy
build-job: # This job runs in the build stage, which runs first.
stage: build
script:
- cd /home/user/projects/agent
- git pull
@myas92
myas92 / vscode_tips.md
Last active May 1, 2022 07:36
vscode extentions
  • Different color themes for different projects (based on stackoverflow solution)

    • Install peacock
    • Press F1
    • Type: Change to a Favorit Color
  • Auto import modules in files

    • Install Auto Import extension
  • Smooth Cursor

  • search cursor in setting

const express = require('express');
const app = express();
const fs = require('fs');
app.get('/', (req, res) => {
const { size } = fs.statSync('input.txt');
const readStreamfile = fs.createReadStream('input.txt', {
encoding: 'UTF-8',
start: 0,
end: size,
highWaterMark: 10
import { Controller, Get, Post, Body, Patch, Param, Delete, Res, HttpStatus, Header } from '@nestjs/common';
import { VideoService } from './video.service';
import { statSync, createReadStream } from 'fs';
import { Headers } from '@nestjs/common';
import { Response } from 'express';
@Controller('video')
export class VideoController {
constructor(private readonly videoService: VideoService) { }
@Get('stream/:id')
import { Injectable } from '@nestjs/common';
import { CreateVideoDto } from './dto/create-video.dto';
import { UpdateVideoDto } from './dto/update-video.dto';
const allVideos = [
{
id: 1,
name: "tom-and-jerry",
duration: '3 mins',
title: 'Tom & Jerry'
},

How to install docker

  • Docker's internal repos is not supported on 20.04 yet so
  • before installation
    • use a proxy or vpn sudo openconnect 986.9104.945.9196
  • sudo apt-get install -y docker.io based on stackoverflow answer
  • for getting images form dockerhub
  • add nameserver of shekan to /etc/resolve.conf -- (sudo /etc/resolve.conf)
    • nameserver 192.168.1.58
  • nameserver 192.168.1.100