Skip to content

Instantly share code, notes, and snippets.

@elektrowolle
elektrowolle / gist:8453b90743eb75ce3b23
Last active January 5, 2017 22:57
Simple Linked List
template <typename Type> class List {
public:
Type value;
List* previousItem;
List* nextItem;
List ( Type value, List *previous = NULL ) {
this->set (value);
this->previousItem = NULL;
this->nextItem = NULL;
@elektrowolle
elektrowolle / Braile.js
Last active March 29, 2016 15:53
braile converter
var endOfLine = '\r\n';
Braile = {};
Braile.en = {};
Braile.en.alphabet = {
"a" : "o- -- --",
"b" : "o- o- --",
"c" : "oo -- --",
"d" : "oo -o --",
"e" : "o- -o --",
"f" : "oo o- --",
//all are /application/json
//Offering an item
// POST request to endpoint /api/postItem
{
itemName: String,
itemPrice: Number,
Description: String,
lockerCode: String,
image: String, //BASE64
//all are /application/json
//Offering an item
// POST request to endpoint /api/postItem
{
itemName: String,
itemPrice: Number,
Description: String,
lockerCode: String,
image: String, //BASE64
#version 150
uniform sampler2DRect tex0;
uniform float blurAmnt = 1.0;
uniform float fvert = 1.0;
out vec4 outputColor;
in vec2 texCoordVarying;
void main()
function sngltonFactory(_cb, _isFaultyCb){
let o = {snglton: _cb()};
_isFaultyCb = _isFaultyCb || ((c)=>typeof c == "undefined");
return function (){
const a = o;
if(_isFaultyCb(a.snglton)) {
a.snglton = _cb();
}
return a.snglton
}
class Path{
Path followingPath;
PVector start;
PVector end;
Float startAngle;
Float endAngle;
Path(PVector start, PVector end, Float startAngle, Float endAngle){
this.start = start;
this.end = end;
@elektrowolle
elektrowolle / auth.h
Last active January 16, 2017 13:38
Lora_step_1
// This EUI must be in little-endian format, so least-significant-byte
// first. When copying an EUI from ttnctl output, this means to reverse
// the bytes. For TTN issued EUIs the last bytes should be 0xD5, 0xB3,
// 0x70.
static const u1_t PROGMEM APPEUI[8]={ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
// This should also be in little endian format, see above.
static const u1_t PROGMEM DEVEUI[8]={ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
// This key should be in big endian format (or, since it is not really a
@elektrowolle
elektrowolle / run2.ino
Last active November 18, 2017 21:00 — forked from sveinb/run2.ino
#define HZ 60.
#define ELE_IN 12
#define ELE_OUT 11
#define WINCH_OUT 10
#define THRUST_IN 9
#define AIL_IN 8
#define AIL_L_OUT 7
#define AIL_R_OUT 6
@elektrowolle
elektrowolle / hashcash_emscripten_make.sh
Last active February 25, 2018 23:40
emscripten hashcash
emcc hashcash.c libhc.c lib*.c sdb.c utct.c lock.c fastmint_ansi_*.c fastmint_altivec_*.c fastmint_mmx_*.c random.c -O3 -o hashcash.js