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 ordered_table = {} | |
--[[ | |
This implementation of ordered table does not hold performance above functionality. | |
It invokes a metamethod `__newindex` for every access, and | |
while this is not ideal performance wise, the resulting table behaves very closely to | |
a standard Lua table, with the quirk that the keys are ordered by when they are first seen | |
(unless deleted and then reinserted.) | |
--]] | |
-- private unique keys | |
local _values = {} |
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
;;; rational-module.el -*- lexical-binding: t; -*- | |
;;; License | |
;; Copyright (C) 2022 | |
;; SPDX-License-Identifier: MIT | |
;; Author: Erik Lundstedt, System Crafters Community | |
;;; Commentary: |
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
#!/bin/bash | |
# This is a shim for libnotify on termux. | |
# Calls termux-notification with translated arguments from notify-send | |
ARGS="" | |
POSITIONAL=() | |
while [[ $# -gt 0 ]]; do | |
case "$1" in | |
-i|--icon) |
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
(require 'ispell) | |
(defun is-plural (noun) | |
"Determine if any word in NOUN has a base (root) word. | |
Uses either ispell, aspell, or hunspell based on user settings." | |
(condition-case err | |
(progn | |
(ispell-set-spellchecker-params) | |
(let* ((words (split-string noun)) |
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
<?php | |
$apiaccess =[ | |
"url" => "https://grocy.yourdomain.tld/api", | |
"key" => "1234password" | |
]; | |
$quantity_units = [ | |
"Cup" => [ | |
"name" => "Cup", | |
"description" => "", | |
"name_plural" => "Cups" |
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
--- A library used for calling and attaching hooks. | |
-- @module Hook | |
Hook = {} | |
local cachedHooks = {} | |
--- Attaches a function to a hook. | |
-- @string hookID The string ID of the hook to be attached to. | |
-- @string uniqueID The unique ID of the function you are attaching to the hook. | |
-- @func func The function to be called when the hook is called. |
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 lpeg = require'lpeg' | |
local P, R, S = lpeg.P, lpeg.R, lpeg.S --patterns | |
local C, Ct = lpeg.C, lpeg.Ct --capture | |
local V = lpeg.V --variable | |
local parser = P { | |
'program', -- initial rule | |
program = Ct(V'sexpr' ^ 0), | |
wspace = S' \n\r\t' ^ 0, | |
atom = V'boolean' + V'integer' + V'string' + V'symbol', |
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
(defpackage :BCM2835 | |
(:use :FFI) | |
(:export :init | |
:close | |
:gpio-fsel | |
:gpio-write | |
:gpio-lev | |
:gpio-set | |
:gpio-clr | |
:delay |