Skip to content

Instantly share code, notes, and snippets.


Thomas Denney thomasdenney

View GitHub Profile
thomasdenney / blockly-png.js
Last active Nov 11, 2020
Generates a PNG image from a Blockly workspace
View blockly-png.js
I've only tested this with in Chrome, but it should work in other browsers
Paste the JS below into the Chrome Developer Tools Console and hit enter
It will then open the generated PNG file in a new tab, from where it can be copied/saved
Based on, with adaptations for styling
and output format
//By default the image will be rendered at the same resolution as your display, but if you increase
//this value you can render a much higher resolution image, which looks better on high density displays
View sujiko.cpp
#include <algorithm>
#include <cstdint>
#include <cstdio>
#include <xmmintrin.h>
typedef int32_t v4 __attribute__ ((vector_size(sizeof(int32_t) * 4)));
inline bool v4equal(v4 a, v4 b)
thomasdenney / microbitread.cpp
Created Jul 13, 2016
Simple echo over serial for PuTTY and micro:bit
View microbitread.cpp
#include "MicroBit.h"
MicroBit uBit;
int main()
while (true) {
uBit.serial.send("What is your name?\r\n");
ManagedString answer = uBit.serial.readUntil("\r");