Skip to content

Instantly share code, notes, and snippets.

View murych's full-sized avatar
👑
I may be slow to respond.

Timur murych

👑
I may be slow to respond.
View GitHub Profile
@murych
murych / CMakeLists.txt
Created November 21, 2019 10:15
blue pill
#THIS FILE IS AUTO GENERATED FROM THE TEMPLATE! DO NOT CHANGE!
SET(CMAKE_SYSTEM_NAME Generic)
SET(CMAKE_SYSTEM_VERSION 1)
cmake_minimum_required(VERSION 3.7)
# specify cross compilers and tools
SET(CMAKE_C_COMPILER_WORKS 1)
SET(CMAKE_C_COMPILER arm-none-eabi-gcc)
SET(CMAKE_CXX_COMPILER_WORKS 1)
SET(CMAKE_CXX_COMPILER arm-none-eabi-g++)
@murych
murych / i2c_scanner.ino
Created November 18, 2019 12:10 — forked from tfeldmann/i2c_scanner.ino
A I2C Scanner for Arduino
// --------------------------------------
// i2c_scanner
//
// Version 1
// This program (or code that looks like it)
// can be found in many places.
// For example on the Arduino.cc forum.
// The original author is not known.
// Version 2, Juni 2012, Using Arduino 1.0.1
// Adapted to be as simple as possible by Arduino.cc user Krodal
@murych
murych / template_lecture.tex
Last active November 7, 2018 20:40
XeLaTeX templates for lecture notes and basic slides w/ Metropolis theme
\documentclass[11pt]{article}
\usepackage[margin=0.2in]{geometry}
% \geometry{a5paper}
\usepackage[quiet]{fontspec}
\usepackage{xunicode}
\usepackage{xltxtra}
\usepackage{polyglossia}
\setdefaultlanguage{russian}
\setmainfont[Ligatures=TeX, Mapping=tex-text]{Linux Libertine}
// предполагается, что светодиоды
// подключаются подряд к портам 1, 2, 3 и т.д.
// допустим, есть 6 светодиодов
#define leds_max 6
#define pot A1
void setup() {
for (int pin = 0; pin < leds_max; ++pin) {pinMode(pin, OUTPUT);}
#include "melodies.h"
#define BUZZER 2
#define LED_EYE 7
#define LED_STOP 8
#define BUTTON_START 5
#define BUTTON_STOP 4
#define BUTTON_MODE 3
const int shortTimer = 5;
% Преамбула документа
\usepackage{listings}
\usepackage{color}
\usepackage{textcomp}
\usepackage[defaultmono]{droidmono}
\definecolor{listinggray}{gray}{0.5}
\definecolor{lbcolor}{rgb}{1,1,1}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@murych
murych / sublime_settings.json
Last active January 18, 2020 14:37
Sublime settings
{
"always_show_minimap_viewport": false,
"bold_folder_labels": false,
"caret_extra_bottom": 2,
"caret_extra_top": 2,
"caret_extra_width": 2,
"caret_style": "phase",
"color_scheme": "Packages/Color Scheme - Default/Celeste.sublime-color-scheme",
"default_line_ending": "unix",
"dictionary": "Packages/User/Russian-English Bilingual.dic",
root@a88e7e9f60ea:/# python /opt/app/bot.py
File "/opt/app/bot.py", line 500
global current_func
^
SyntaxError: name 'current_func' is used prior to global declaration
root@a88e7e9f60ea:/# python
Python 3.6.2 (default, Jul 24 2017, 19:47:39)
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
@murych
murych / large-file-hash.py
Created July 18, 2017 11:02 — forked from aunyks/large-file-hash.py
Hash a large file in Python
import hashlib as hash
# Specify how many bytes of the file you want to open at a time
BLOCKSIZE = 65536
sha = hash.sha256()
with open('kali.iso', 'rb') as kali_file:
file_buffer = kali_file.read(BLOCKSIZE)
while len(file_buffer) > 0:
sha.update(file_buffer)