Skip to content

Instantly share code, notes, and snippets.

View maximzakharov's full-sized avatar
🍄

Maxim Zakharov maximzakharov

🍄
View GitHub Profile
@maximzakharov
maximzakharov / repo-full-copy.sh
Created September 26, 2022 11:32 — forked from AgiosAndreas/repo-full-copy.sh
Полный перенос git репозитория на другой сервер
# Клонируем исходный репозиторий без рабочего каталога (--bare)
git clone --bare https://github.com/exampleuser/old-repository.git
cd old-repository.git
# Делаем mirror-push(будут скопированы все ветки и тэги) в новый репозиторий
git push --mirror https://github.com/exampleuser/new-repository.git
cd ..
# Удаляем папку с репозиторием
//
// Created by Maxim Zakharov on 04.09.2020.
//
#include <stm32wbxx_hal.h>
#include <stdint.h>
#include <basic_i2c.h>
#include <nbo_util.h>
#include <math.h>
#include <FreeRTOSConfig.h>
#include <board.h>
@maximzakharov
maximzakharov / delete_git_submodule.md
Created January 14, 2021 10:55 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@maximzakharov
maximzakharov / fused_algo.c
Last active September 12, 2019 06:57
Описание работы алгоритма hr
if (CounterSamples >= HR_SIZE_WINDOW) {
CounterSamples = 0;
algo_is_finish = true;
placement_t placement = status_get_placement();
if (placement == PLACEMENT_NOT_ON_WRIST) {
return;
}
\x92\x00\x00\x00 // Длина объекта 121
\x09\time\x00\x18\xed\x1f\x5d\x5e\x01\x00\x00 // Время и дата UNIX (1,504800927×10E12 мс - Thu, 07 Sep 2017 16:15:27 GMT)
\x05\id\x00\x10\x00\x00\x00\x01\x01\x43\xc7\xcb\x07\x11\x48\x03\x01\x00\x00\x00\x00\x00\x00\x00 //Device ID: Type device - "band", Color = #43C7CB, date=0717 (Июль 2017), country=840 (USA), serial number=0x0000000000000001
\10\ver\x00\x1f\x00\x40\x00 // Версия прошивки (4194335 - 1.0.31)
\x08\wr\x00\x01 // Надет ли браслет (true)
\x10\gl\x00\x40\xe2\x01\x00 // Напряжение с зеленого светодода (123456)
\x10\rl\x00\x55\xf8\x06\x00 // Напряжение с красного светодода (456789)
@maximzakharov
maximzakharov / gist:c6d888183dff00bca4ea1c40bad7b63b
Last active April 25, 2017 09:35
Узнать свободную память у задачи по ее имени
printf("byte = %d\n", (int)uxTaskGetStackHighWaterMark(xTaskGetHandle(TCPIP_THREAD_NAME)));
[alias]
co = checkout
ci = commit
st = status
br = branch
df = diff --name-only
hist = log --pretty=format:'%ad %s%d [%an]' --oneline --decorate
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset— %C(bold yellow)%an' --abbrev-commit --date=relative
l = log --graph --all --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ad)%C(reset) %C(white)%s%C(reset) %C(bold white)— %an%C(reset)%C(bold yellow)%d%C(reset)' --abbrev-commit --date=local
commend = commit --amend --no-edit