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
const attr = "data-gtm" | |
const gtm = document.head.querySelector(`script[${attr}]`) // basically reference to itself | |
if(gtm) { | |
window["dataLayer"] = window["dataLayer"] || [] | |
window["dataLayer"].push({ | |
"event": "gtm.js", | |
"gtm.start": new Date().getTime() | |
}) |
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
#pragma once | |
#define TAPPING_TERM 100 // I'm mainly using this for modifiers, etc | |
#define KEY_TAP_TIMEOUT 190 // same meaning as TAPPING_TERM but for the rest of the regular keys (KC_A ... KC_Z) | |
#define PREVENT_STUCK_MODIFIERS | |
//#define STM32_SYSCLK KINETIS_SYSCLK_FREQUENCY | |
//#define NOP_FUDGE 0.4 | |
//#define RGB_DI_PIN LINE_PIN28 | |
//#define RGBLED_NUM 4 |
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
-- 2020 (c) [email protected] | |
-- IMPORTANT NOTE for Lua < 5.1 | |
-- When using this class to hotload other modules, be sure to count tables WITH table.getn and NOT with # !!! | |
-- Lua 5.1 and prior don't support overriding # via .__len metamethod - so our best bet here is to modify table.getn | |
-- and use table.getn whenever we have to check the number of entires in numerical tables | |
local _require = require | |
local _ipairs = ipairs | |
local _pairs = pairs |
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
-- 2019 (c) [email protected] | |
-- Providing object inheritance, the correct way! | |
-- Support for getters and setters! | |
-- (Getter/Setter name can even be a regex expression! - But be careful your namin as "get_%w+" for example would override the entire standard proxy behaviour of class_mt.__index or cast_mt.__index - This can be either a powerful feature or produce unintended results.) | |
-- Classes are linked through __parent objects inside of each (sub-)class until they finally get instanciated | |
-- (the base-class is assigned as the __index metatable) | |
-- This way we can extend parent classes or change their methods even after their creation while still being able to see these changes in the sub-classes | |
-- Instances of classes are deep-copies down their entire inheritance chain |
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
--# Main | |
-- mysql adapter | |
-- | |
-- TODO: write higher level API to mysql | |
-- app should cache inputs and push to mysql when server available | |
-- also queries should be wrapped in coroutines or something, to be async? | |
function setup() |
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
--# Main | |
supportedOrientations(LANDSCAPE_ANY) | |
displayMode(OVERLAY) | |
function setup() | |
scene = craft.scene() |
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
--# Main | |
-- Procreate Animation Player [v1] | |
-- (c) kennstewayne.de | |
-- | |
-- Works only with Dropbox for now! | |
-- | |
displayMode(FULLSCREEN) | |
function setup() |
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 _line = line | |
local function lineCap(d) | |
for x = 1, d do | |
y = math.sqrt(d*d - x*x) | |
rect(0, 0, x, y) | |
end | |
end | |
function line(x1, y1, x2, y2, capMode) |
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 _line = line | |
local function lineCap(d) | |
for x = 1, d do | |
y = math.sqrt(d*d - x*x) | |
rect(0, 0, x, y) | |
end | |
end | |
function line(x1, y1, x2, y2, capMode) |
NewerOlder