This file contains hidden or 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
/* | |
* 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); | |
* } |
This file contains hidden or 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
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); |
This file contains hidden or 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
sudo apt install cpu-checker | |
kvm-ok | |
sudo nano /etc/apt/sources.list | |
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add - | |
sudo apt-get update | |
sudo apt update | |
sudo apt-get install linux-headers-$(uname -r) build-essential virtualbox-5.1 dkms | |
sudo adduser <user> vboxusers |
This file contains hidden or 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
// Taken from http://stackoverflow.com/questions/19614583/google-apps-script-to-delete-all-files-from-google-drive | |
function processAllFiles() { | |
// We look for the continuation token from the UserProperties | |
// this is useful as the script may take more that 5 minutes | |
// (exceed execution time) | |
var continuationToken = UserProperties.getProperty('DELETE_ALL_FILES_CONTINUATION_TOKEN'); | |
if (continuationToken == null) { | |
// firt time execution, get all files from drive | |
var files = DriveApp.getFiles(); |
This file contains hidden or 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
HAL_StatusTypeDef spi3wireRead(uint8_t *pTxData, uint8_t *pRxData, uint16_t TxSize, uint16_t RxSize) | |
{ | |
if(hspi1.State != HAL_SPI_STATE_READY) | |
{ | |
return HAL_BUSY; | |
} | |
if((pTxData == NULL ) || (TxSize == 0U)) | |
{ |
This file contains hidden or 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
# udev rule : SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="5740", MODE="0666", SYMLINK+="lsm303agr" | |
import serial | |
import re | |
import time | |
import signal | |
import math | |
# registers |
This file contains hidden or 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
#!/bin/sh | |
mkdir ~/scripting | |
cd ~/scripting | |
i=1 | |
out=0 | |
while [ $out -eq "0" ] | |
do |
This file contains hidden or 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
var githubApi = {}; | |
githubApi.header = {}; | |
githubApi.header.Accept = "application/vnd.github.v3+json"; //make sure we use v3 | |
//githubApi.header.Authorization = "token <token>"; | |
githubApi.baseUrl = "https://api.github.com"; | |
githubApi.username = "indriApollo"; | |
githubApi.nameRepo = "vormleer"; | |
githubApi.list = {}; |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Bresenham demo</title> | |
<style type="text/css"> | |
.demo { | |
margin: auto; | |
width: 466px; | |
} |