esptool.py --port <PORT> --baud 460800 write_flash -e --flash_size=detect -fm dout 0 <FIRMWARE ADDRESS>
NOTICE: after install, default baud rate is 115200
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
import serial | |
ser = serial.Serial('/dev/ttyACM0', baudrate=9600, timeout=1) | |
data = ser.readline() | |
data = str(data, encoding='utf-8') | |
data = data.strip() | |
ser.close() | |
ser.open() |
Direct link to uploaded file on github repo
https://raw.githubusercontent.com/{username}/{repo name}/{branche}/{directory + filename}
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
import network | |
# wlan = network.WLAN(network.STA_IF) | |
# wlan.active(True) | |
# wlan.connect('mthri', '123456789') | |
# print('connecting...') | |
# while not wlan.isconnected(): | |
# pass | |
# print('connected!') |
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
def login_one_session(request, user): | |
from importlib import import_module | |
from django.core.cache import cache | |
# Get Session Key and Prefix | |
from django.contrib.auth import SESSION_KEY | |
from django.contrib.sessions.backends.cache import KEY_PREFIX | |
# login authorized user | |
login(request, user) |
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
import requests | |
from flask import Flask | |
app = Flask(__name__) | |
TARGET_URL = '' | |
@app.route('/') | |
def index(): | |
request = requests.get(TARGET_URL) | |
return request.text |
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
/* | |
<div class="form-group col-md-6"> | |
<label for="organization-name" class="float-right">جزئیات نام</label> | |
<input type="text" class="form-control" id="organization-name" name="organization_name" required> | |
<div><ul class="errorlist text-right"></ul></div> | |
</div> | |
*/ | |
function show_error(form, errors){ | |
for (const [key, value] of Object.entries(errors)) { |
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 full_fill_check(target_element) { | |
let all_required_checked = true | |
$(target_element).find('input:required').each((index, element) => { | |
if (!$(element).val()) { | |
$(element).attr('placeholder', '*اجباری') | |
all_required_checked = false | |
} | |
}) | |
if (!all_required_checked) { | |
Swal.fire( |
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
#!/bin/bash | |
# Removes old revisions of snaps | |
# CLOSE ALL SNAPS BEFORE RUNNING THIS | |
set -eu | |
LANG=en_US.UTF-8 snap list --all | awk '/disabled/{print $1, $3}' | | |
while read snapname revision; do | |
snap remove "$snapname" --revision="$revision" | |
done |
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 USER 'root'@'%' IDENTIFIED BY 'some_pass'; | |
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'; | |
FLUSH PRIVILEGES; |