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
/*! | |
* @license | |
* TradingView Lightweight Charts™ v4.1.2 | |
* Copyright (c) 2023 TradingView, Inc. | |
* Licensed under Apache License 2.0 https://www.apache.org/licenses/LICENSE-2.0 | |
*/ | |
(function () { | |
'use strict'; | |
/** |
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
@echo off | |
rem mkdir workspace | |
rem copy _cmd.bat . | |
rem cd workspace | |
rem virtualenv .venv | |
Set workdir=%cd%\.venv | |
rem echo VIRTUALENV: %workdir% | |
For /F "delims=\" %%A in ("%workdir%") do ( | |
Set Name=%%~nxA |
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
Get-ChildItem -Path . -Recurse -Filter *.dll -File -Name | Unblock-File |
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 os import chdir | |
from os.path import dirname | |
import multiprocessing | |
import numpy as np | |
import pandas as pd | |
import asyncio | |
from lightweight_charts import Chart | |
async def main(): | |
#print(sys._MEIPASS) |
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
# https://mike.depalatis.net/blog/tornado-background-tasks.html | |
@tornado.concurrent.run_on_executor | |
def refresh(): | |
do_something_that_takes_a_while() | |
tornado.ioloop.IOLoop.instance().add_callback(self.refresh) |
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 st_socketio import sio, st_socketio | |
import streamlit as st | |
@sio.on('chat') | |
async def chat_event(sid, data, auth): | |
print('chat ', sid, data, auth) | |
await sio.emit('chat', data[::-1], sid); | |
return "OK", sid | |
@sio.event |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="width=device-width,initial-scale=1.0"> | |
<title>Socket.IO chat</title> | |
<style> | |
#messages { list-style-type: none; margin: 0; padding: 0; } | |
#messages > li { padding: 0.5rem 1rem; } | |
#messages > li:nth-child(odd) { background: #efefef; } | |
</style> |
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
to generate example certs | |
openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout host.key -out host.crt | |
run server: | |
chmod +x server.py | |
./server.py | |
test server: | |
openssl s_client -connect localhost:8888 |
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
REM | |
REM Copy this file to the ROOT FOLDER of python virtual environment | |
REM === by sefgit | |
REM | |
@set "VIRTUAL_ENV=%cd%" | |
@if defined _OLD_VIRTUAL_PROMPT ( | |
@set "PROMPT=%_OLD_VIRTUAL_PROMPT%" | |
) else ( | |
@if not defined PROMPT ( |
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
## Install Python3.9 interpreter on ubuntu 22.04 | |
On a terminal just do the following steps: | |
Install dependencies: | |
sudo apt install tar build-essential checkinstall libreadline-dev \ | |
libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev \ | |
libbz2-dev openssl libffi-dev |