Skip to content

Instantly share code, notes, and snippets.

void rotateImage(int16_t angle) {
float rad = angle/180.0f*M_PI;
float midX, midY;
float deltaX, deltaY;
int16_t rotX, rotY;
uint16_t x, y;
uint16_t height = 272;
uint16_t width = 272;
// Optimization: calc the sin and cos only once
float _sin = sin(rad);
/*
* Inspired by http://www.openstm32.org/forumthread2267
* Use this code to enable serial communication over the stm32f746g-disco's USB STLINK
* test code example:
* uint8_t msg[] = "hello world!\n";
* while (1)
* {
* HAL_UART_Transmit(&huart1, msg, sizeof(msg), 100);
* HAL_Delay(500);
* }
# setup
apt install qemu-kvm libvirt-bin virtinst bridge-utils
# modify /etc/network/interfaces (replace eth0 with br0)
auto br0
iface br0 inet static
address 192.168.0.10
network 192.168.0.0
netmask 255.255.255.0
# list lvm partitions
sudo lvmdiskscan
sudo lvdisplay
# mount lvmgroup/lvmvol
sudo mount /dev/<VolGroup00?>/<LogVol00?> /mnt # /dev/VG_Name/LV_Name
# check if lvm used by vm
virsh list
virsh edit <vm name> # look for device='disk'
#!/usr/bin/env node
const nodemailer = require("nodemailer");
let smtpConfig = {
host: 'smtp.gmail.com',
port: 587,
secure: false, // upgrade later with STARTTLS
auth: {
user: 'xxx@gmail.com',
#include <stdio.h>
#include <stdint.h>
static void shellSort(uint8_t* a, size_t n)
{
uint8_t t;
size_t h = n, i, j;
while(h /= 2)
{
for(i = h; i < n; i++)
<!DOCTYPE html>
<html>
<body>
<canvas id="myCanvas" width="300" height="100" style="border:1px solid #d3d3d3;">
Your browser does not support the HTML5 canvas tag.</canvas>
<script>
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
@indriApollo
indriApollo / pps.py
Last active February 6, 2021 02:12
pierre papier ciseaux bodeux
#!/usr/bin/env python3
# pierre - papier - ciseau
# 2 joueurs
# input des noms
# n parties jouées
import random
choices = ["paper", "rock", "scissor"]
void print_triangle(unsigned char width)
{
unsigned char rows = (width + 1) / 2;
for (unsigned char i = 0; i < rows; i++)
{
for(unsigned char j = 0; j < rows-i-1; j++)
{
printf(" ");
}
for(unsigned char k = 0; k < (i*2)+1; k++)
@indriApollo
indriApollo / track-stats-wear.md
Last active April 1, 2024 02:19
Trackdays stats & wear

Nissan 350Z

Circuit Jules Tacheny Mettet

2022-04-21 & 2022-05-19

8 x 25 mins

Consumables pricewatch