This file contains 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
// Example testing sketch for various DHT humidity/temperature sensors | |
// Written by ladyada, public domain | |
#include "Grove_Temperature_And_Humidity_Sensor.h" | |
#define PIN_GROVE_POWER 15 // https://github.com/esphome/issues/issues/223 | |
// Uncomment whatever type you're using! | |
#define DHTTYPE DHT11 // DHT 11 | |
// #define DHTTYPE DHT22 // DHT 22 (AM2302) | |
//#define DHTTYPE DHT21 // DHT 21 (AM2301) |
This file contains 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
../bench/corgis/website/datasets/json/tate/tate.json (2.60 MiB) | |
Action Duration Used Kept Output | |
cjson_resty.decode 38.9ms 3.87 MiB 3.63 MiB table: 0x419b8440 | |
Tibs.decode 42.1ms 2.95 MiB 2.91 MiB table: 0x4209dad8 | |
cjson_resty.encode 13.2ms 1.88 MiB 1.88 MiB string: 1.88 MiB | |
Tibs.encode 48.3ms 8.24 MiB 1.97 MiB string: 1.84 MiB | |
encoded sizes mismatch: 1968571 1933719 | |
cjson_resty = "data":{"url":"http:\/\/www.tate.org.uk\/ |
This file contains 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
do | |
-- Polyfill for luajit without __pairs and __ipairs extensions | |
local triggered = false | |
pairs(setmetatable({}, { __pairs = function() | |
triggered = true | |
return function() end | |
end })) | |
if not triggered then | |
print "Polyfilling pairs" | |
function _G.pairs(t) |
This file contains 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
FROM alpine AS build-luv | |
RUN apk add build-base cmake git | |
RUN git clone --recursive https://github.com/luvit/luvi.git | |
RUN make -C luvi/deps/luv | |
FROM alpine AS build-luvi | |
RUN apk add build-base cmake git | |
RUN git clone --recursive https://github.com/luvit/luvi.git | |
RUN apk add perl linux-headers | |
RUN make -C luvi regular-asm |
This file contains 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
--- xxHash | |
--- https://github.com/Cyan4973/xxHash/blob/dev/doc/xxhash_spec.md#xxh32-algorithm-description | |
local bit = require 'bit' | |
local rshift = bit.rshift | |
local rol = bit.rol | |
local bxor = bit.bxor | |
local tobit = bit.tobit | |
local ffi = require 'ffi' |
This file contains 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
local bit = require 'bit' | |
local bxor = bit.bxor | |
local rol = bit.rol | |
local lshift = bit.lshift | |
local band = bit.band | |
local bor = bit.bor | |
local function gimli(state) | |
for round = 24, 1, -1 do | |
for column = 0, 3, 1 do |
This file contains 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
count=9; | |
h=100; | |
r=27; | |
s=4; | |
g=1.1; | |
w=(r+s)*(count+1)+s*2; | |
echo(w); | |
d=(r+s)*(2+2*sin(60))+s*2; |
This file contains 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
// ESC := "^" | |
ESC := "\x1b" | |
WIDTH := 33 | |
HEIGHT := 32 | |
FPS := 120 | |
SIZE := WIDTH * HEIGHT | |
pixels := ByteArray(SIZE) | |
dirty_x1 := 0 | |
dirty_y1 := 0 |
This file contains 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 Neopixel = require('neopixel'); | |
var data = new Uint8Array(4*12); | |
function hue(p, h, l) { | |
h = h % 0x600; | |
var r, g, b; | |
if (h < 0x100) { r = 0xff; g = h; b = 0; } | |
else if (h < 0x200) { r = 0x1ff - h; g = 0xff; b = 0; } |
This file contains 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
/* types | |
Button - represents a GPIO pin hooked to a button | |
Neopixel - represents a GPIO pin hooked to neopixels | |
Strip - represents a memory buffer for 1d array of colors | |
Grid - represents a memory buffer for a 2d array of colors | |
Position1d - represents a bounded 2D coordinate | |
Position2d - represents a bounded 2D coordinate | |
Interval - represents a clock 33345rtfv ith a given frequency | |
Schedule - represents a schedule to alarm at given times | |
Color - represents a 24 bit RGB color |
NewerOlder