Skip to content

Instantly share code, notes, and snippets.

@zerotacg
zerotacg / build.gradle
Last active December 13, 2022 23:02
print coverage stats for usage in gitlab coverage
import groovy.xml.XmlParser
import java.text.DecimalFormat
tasks.register('koverStats') {
dependsOn ':koverXmlReport'
def percentageFormat = new DecimalFormat("#.##%")
ext.srcFile = new File(buildDir, 'reports/kover/xml/report.xml')
inputs.file srcFile
doLast {
println "Coverage Stats."
@zerotacg
zerotacg / arduino-rc-receiver.ino
Created June 17, 2017 18:16
simple unoptimized arduino code to read data from an rc receiver and send via serial
#define CHANNEL_0 14
#define CHANNEL_1 15
#define CHANNEL_2 16
uint16_t ch0;
uint16_t ch1;
uint16_t ch2;
void setup() {
Serial.begin(19200);
function request( delay, value, fail )
{
return new Promise(function( fullfill, reject ) {
setTimeout( (fail ? reject : fullfill).bind( this, value), delay );
});
}
var render = console.log.bind( console, "render" )
, error = console.log.bind( console, "error" )
;