Skip to content

Instantly share code, notes, and snippets.

View volodink's full-sized avatar
🏠
Working from home

Konstantin Volodin volodink

🏠
Working from home
View GitHub Profile

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

public class Customer {
private Long id;
private String name;
private Integer tier;
public Long getId() {
return id;
}
@volodink
volodink / forEach.cpp
Created October 9, 2022 11:19 — forked from victorholt/forEach.cpp
C++ ForEach Example
#include <iostream>
#include <string>
#include <functional>
#include <vector>
template<class ArrayType, class ValueType>
void forEach(const ArrayType& arr, std::function<void(const ValueType&)> callback) {
for (auto entry : arr) {
callback(entry);
}
@volodink
volodink / open-in-gitpod.md
Created March 22, 2022 10:54 — forked from tianhaoz95/open-in-gitpod.md
Code to add a open in Gitpod badge

Here is your awesome Open in Gitpod badge

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/[your GitHub username]/[your repository])

Open in Gitpod

from typing import List, Dict
from fastapi import FastAPI
import motor.motor_asyncio
from bson import ObjectId
from pydantic import BaseModel, Field
class PyObjectId(ObjectId):
@classmethod
@volodink
volodink / MSP_ATTITUDE.ino
Created March 5, 2021 09:01 — forked from Xorgon/MSP_ATTITUDE.ino
An Arduino sketch for getting attitude data from a flight controller using MSP.
#include <SoftwareSerial.h>
#define MSP_ATTITUDE 108
SoftwareSerial mspSerial(11, 12); // RX TX
void setup() {
mspSerial.begin(9600);
Serial.begin(9600);
}
@volodink
volodink / matplotlibtest.py
Created October 30, 2019 18:51
matplotlibtest
import numpy as np
from matplotlib import pyplot as plt
plt.rcParams['figure.figsize'] = [10, 5]
x = np.arange(0, 2 * np.pi, 0.1)
y = 5 * np.sin(x)
plt.plot(x, y)
plt.title('test and тест русского')
plt.xlabel('Time, sec')
void setup() {
// put your setup code here, to run once:
pinMode(3, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
Serial.begin(115200);
}
void loop() {
float sinValue = 0.0f;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
float sinValue = 3.3f * sin(0.025f * millis());
Serial.println(sinValue);
@volodink
volodink / gsm test2
Created October 5, 2018 12:57
gsmtest2
#include <SoftwareSerial.h>
SoftwareSerial gsm(10, 11); // RX, TX
SoftwareSerial gps(2, 3); // RX, TX
char response[100];
void setup() {
pinMode(5, OUTPUT);
digitalWrite(5, LOW);