Skip to content

Instantly share code, notes, and snippets.

View shivampip's full-sized avatar
🏡
In Quarantine

Shivam Agrawal shivampip

🏡
In Quarantine
View GitHub Profile
import logging
import uuid
from sanic import Blueprint, response
from sanic.request import Request
from socketio import AsyncServer
from typing import Optional, Text, Any, List, Dict, Iterable
from rasa.core.channels.channel import InputChannel
from rasa.core.channels.channel import UserMessage, OutputChannel
import asyncio
import inspect
import json
import logging
import uuid
from asyncio import Queue, CancelledError
from sanic import Sanic, Blueprint, response
from sanic.request import Request
from typing import Text, List, Dict, Any, Optional, Callable, Iterable, Awaitable
@shivampip
shivampip / pipenv_cheat_sheet.md
Last active November 11, 2019 18:26 — forked from bradtraversy/pipenv_cheat_sheet.md
Pipenv cheat sheet for common commands

Pipenv Cheat Sheet

Install pipenv

pip3 install pipenv

Activate

pipenv shell
@shivampip
shivampip / fabric_demo.md
Last active November 13, 2019 06:59
Python SSH Client (Fabric built on top of Paramiko & Invoke)

Fabric is a high level Python (2.7, 3.4+) library designed to execute shell commands remotely over SSH, yielding useful Python objects in return

Installation

pip install fabric

Connect to VPS and Execute commands

from fabric import Connection
@shivampip
shivampip / git_unix_store_credentials.md
Created November 18, 2019 14:50
Unix Store Git Credentials
  • Run this cmd
git config credential.helper store
  • Perform push/pull (it will ask username and password once and then store them)
  • Next time not username or password
@shivampip
shivampip / vps_management.md
Last active November 20, 2019 02:56
VPS Management

Install VPS Monitoring Tool

curl https://raw.githubusercontent.com/ajenti/ajenti/master/scripts/install.sh | sudo bash -s -
  • Once installed, access with
:8000
@shivampip
shivampip / react_app_on_gh_pages.md
Last active July 9, 2020 11:39
Deploy React App on Github Pages

Deploy React App on Github Pages

  • My github username is shivampip, in below steps, replace it with yours
  • Say you have a react app named ghtest
  • Create new repo on github with same name as react app. i.e. ghtest
  • Now on local react app repo, install gh-pages module
npm install --save gh-pages
  • Now in package.json, add these line below name
@shivampip
shivampip / package.json
Last active January 28, 2020 08:21
[Embadded on Medium]
{
"name": "ghtest",
"homepage": "https://shivampip.github.io/ghtest/",
"version": "0.1.0",
"private": true,
"dependencies": {
"gh-pages": "^2.2.0",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-scripts": "3.3.0"
@shivampip
shivampip / css_div_h_v_align_center.css
Created February 3, 2020 06:49
CSS Vertical and Horizontal align center
.outer {
display: flex;
justify-content: center;
align-items: center;
}
.innter{
align-self: center; /*optional*/
}
@shivampip
shivampip / Div_inside_div_margin_100.md
Last active February 3, 2020 18:45
Div inside div with 100% height/width and padding/margin

By setting this property with the value "border-box" it makes whichever element you apply it to not stretch when you add a padding or border. If you define something with 100px width, and 10px padding, it will still be 100px wide.

box-sizing: border-box;  // on parent