This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer # python2 | |
from http.server import BaseHTTPRequestHandler, HTTPServer # python3 | |
class HandleRequests(BaseHTTPRequestHandler): | |
def _set_headers(self): | |
self.send_response(200) | |
self.send_header('Content-type', 'text/html') | |
self.end_headers() | |
def do_GET(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir learnnlp && cd learnnlp | |
git clone https://github.com/fastai/course-nlp course | |
sudo docker run -p 8888:8888 -v "$(pwd)"/course:/home/jovyan/work jupyter/scipy-notebook |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// CREATE add data | |
const data = { | |
"name":"Trff vgtt", | |
"email": "[email protected]", | |
"phno": 2134445 | |
}; | |
fetch('https://<app_id>.mockapi.io/v1/users', { | |
method: 'POST', | |
headers: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# creating a secret key using random | |
import os | |
os.urandom(24) | |
# '\x17\x96e\x94]\xa0\xb8\x1e\x8b\xee\xdd\xe9\x91^\x9c\xda\x94\t\xe8S\xa1Oe_' | |
os.urandom(24).encode('hex') | |
# 'cd48e1c22de0961d5d1bfb14f8a66e006cfb1cfbf3f0c0f3' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function prompt/color(){ | |
local RED="\e[31m" | |
local GREEN="\e[32m" | |
local YELLOW="\e[33m" | |
local BLUE="\e[34m" | |
local INPUTCOLOR=$1 | |
eval "COLOR="\${$INPUTCOLOR} | |
local TEXT=$2 | |
local ENDCOLOR="\e[0m" |
OlderNewer