Skip to content

Instantly share code, notes, and snippets.

View artursg's full-sized avatar
🚬

Artur Sagitov artursg

🚬
View GitHub Profile
@artursg
artursg / parse_h265.py
Created June 14, 2023 08:46 — forked from figgis/parse_h265.py
H.265/HEVC bitstream parser
#!/usr/bin/env python
"""
- ae(v): context-adaptive arithmetic entropy-coded syntax element. The parsing process for this descriptor is
specified in clause 9.3.
- b(8): byte having any pattern of bit string (8 bits). The parsing process
for this descriptor is specified by the return value of the function
read_bits( 8 ).
- f(n): fixed-pattern bit string using n bits written (from left to right)
$HOME/.config/Code/User/settings.json {
"workbench.iconTheme": "material-icon-theme",
"workbench.colorTheme": "Solarized Dark",
"ros.distro": "melodic",
"git.autofetch": true,
"window.titleBarStyle": "custom",
"editor.fontFamily": "'Hack', 'monospace', monospace, 'Droid Sans Fallback'",
"editor.renderLineHighlight": "all",
"editor.renderWhitespace": "selection",
"editor.cursorBlinking": "solid",
@artursg
artursg / rfbi-kias-scrapper.py
Created November 29, 2019 02:56
Scrapping KIAS projects info.
import urllib.parse
import urllib.request
import requests
from bs4 import BeautifulSoup
url = 'https://kias.rfbr.ru/person_projects.php'
url_project_attributes = 'https://kias.rfbr.ru/get_project_form_attributes.php'
url_project_info = 'https://kias.rfbr.ru/project.php'
url_project_doc = 'https://kias.rfbr.ru/project_forms.php'
values = {
// ==UserScript==
// @name Aliexpress
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://trade.aliexpress.com/orderList.htm*
// @grant unsafeWindow
// @grant GM_xmlhttpRequest
// @grant GM_setClipboard
#!/bin/bash
PREFIX='http:\/\/galler.com'
NAME='model-1'
mkdir $NAME
for model_page in $(cat "$1" | xargs curl -s | sed -ne 's/.*\.\.\(\S*\.html\)\" target.*/+\1/p')
do
for set in $(echo $model_page | sed -e 's/+/$prefix/')
do
SET_DIR=$(basename $set .html)
mkdir -v $NAME/$SET_DIR
#!/usr/bin/env python
# coding: utf-8
import pandas as pd
r = pd.read_csv('detector.csv', header=None)
r = r.drop(columns=[0, 2])
r = r.rename(index=str, columns={1 : "log", 3 : "is_detected" })
d = r["log"].str.extract(r'frame(\d+)_angle(\d+)_turn(\d+)')
r = r.assign(frame=d[0], angle=d[1], turn=d[2])
@artursg
artursg / curl-jpeg-links.bash
Created May 5, 2019 00:13
curl-jpeg-links.bash
import numpy as np
import matplotlib.pyplot as plt
s = np.linspace(0, np.pi)
R = 4
alpha=360/(2*R*np.pi)
rad_degree = np.pi/180
x_0 = R
y_0 = 0
angles = np.arange(alpha, 360, alpha)
@artursg
artursg / get_images_gist.js
Last active October 11, 2018 12:50 — forked from tobek/get-image-urls.js
Save images from chrome inspector network tab
/* right click on an entry in the network log, select Copy All as Har
* type in console: x = paste_link_here
* paste the following JS code into the console
* copy the output, paste into a file
* then wget -i [that file]
*/
(function(logObj, mime) {
var results = [];
logObj.log.entries.forEach(function (entry) {
if (mime && entry.response.content.mimeType !== mime) return;