This file contains 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
#include <unistd.h> | |
#include <stdint.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <termios.h> | |
#include <stdio.h> | |
#define BAUDRATE B9600 | |
#define MODEMDEVICE "/dev/ttyAMA0" |
This file contains 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
#include <stdio.h> | |
/// Prints float to buffer without using %f (for microcontrollers purpose) | |
/// | |
/// Usage: | |
/// char buffer[20]; | |
/// printFloatToBuffer(buffer, 20, -3.1415, 3); | |
/// printf("%s", buffer); | |
/// | |
void printFloatToBuffer(char *buffer, size_t bufferSize, float val, unsigned int precision) { |
This file contains 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
project(simple_tests) | |
cmake_minimum_required(VERSION 2.8) | |
aux_source_directory(. SRC_LIST) | |
add_definitions(-DBOOST_TEST_DYN_LINK) | |
find_package(Boost COMPONENTS unit_test_framework REQUIRED) | |
add_executable(${PROJECT_NAME} ${SRC_LIST}) | |
target_link_libraries(${PROJECT_NAME} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) |
This file contains 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 smtplib | |
fromaddr = '' | |
toaddrs = '' | |
msg = "\r\n".join([ | |
"From: %s" % fromaddr, | |
"To: %s" % toaddrs, | |
"Subject: THIS PYTHON SHIT IS WORKING!!!", | |
"", | |
]) |
This file contains 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 sys, random | |
from PyQt5.QtWidgets import (QMainWindow, QFrame, | |
QDesktopWidget, QApplication) | |
from PyQt5.QtCore import Qt, QBasicTimer, pyqtSignal | |
from PyQt5.QtGui import QPainter, QColor | |
class Tetris(QMainWindow): | |
def __init__(self): | |
super().__init__() |
This file contains 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 sys | |
from PyQt5.QtWidgets import (QWidget, QLabel, | |
QComboBox, QApplication) | |
class Example(QWidget): | |
def __init__(self): | |
super().__init__() | |
self.initUI() |
This file contains 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 sys | |
from PyQt5.QtWidgets import (QWidget, QHBoxLayout, QFrame, | |
QSplitter, QApplication) | |
from PyQt5.QtCore import Qt | |
class Example(QWidget): | |
def __init__(self): | |
super().__init__() | |
self.initUI() |
This file contains 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 sys | |
from PyQt5.QtWidgets import (QWidget, QCalendarWidget, | |
QLabel, QApplication) | |
from PyQt5.QtCore import QDate | |
class Example(QWidget): | |
def __init__(self): | |
super().__init__() | |
self.initUI() |
This file contains 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 sys | |
from PyQt5.QtWidgets import (QWidget, QProgressBar, | |
QPushButton, QApplication) | |
from PyQt5.QtCore import QBasicTimer | |
class Example(QWidget): | |
def __init__(self): | |
super().__init__() | |
self.initUI() |
NewerOlder