This file contains hidden or 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
# /etc/telegraf/telegraf.d/monero.conf | |
[[inputs.exec]] | |
name_override = '''monerod''' | |
interval = '''60s''' | |
commands = ['''curl --silent --data '{"jsonrpc":"2.0","id":"0","method":"get_info"}' http://localhost:18081/json_rpc'''] | |
timeout = '''30s''' | |
# See https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_INPUT.md |
This file contains hidden or 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
#!/usr/bin/env python3 | |
# Copyright 2023 Google LLC | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software |
This file contains hidden or 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'': [''a''], ''b'': [''b''], ''d'': [''LEFT'']}|combine( | |
{''a'': [''a''], ''c'': [''c''], ''d'': [''RIGHT'']}) | |
a: | |
- a | |
b: | |
- b | |
c: | |
- c | |
d: |
This file contains hidden or 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
{-# LANGUAGE TypeFamilies #-} | |
import Data.Functor | |
import Data.Functor.Compose | |
import qualified Data.Foldable as F | |
import Data.Knot | |
import qualified Data.Map as M | |
import qualified Data.Traversable as T | |
-- * Functor data types | |
-- ** Person' |
This file contains hidden or 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
primes :: [Integer] | |
primes = 2 : filter isPrime [3,5..] | |
isPrime :: Integer -> Bool | |
isPrime n = all (\p -> n `rem` p /= 0) . takeWhile (\p -> p^2 <= n) $ primes |
This file contains hidden or 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
Empty | |
FIFO [0] Empty 1 [] 0 | |
FIFO [0] Empty 1 [1] 1 | |
FIFO [0] (FIFO [[1,2]] Empty 1 [] 0) 3 [] 0 | |
FIFO [0] (FIFO [[1,2]] Empty 1 [] 0) 3 [3] 1 | |
FIFO [0] (FIFO [[1,2]] Empty 1 [] 0) 3 [4,3] 2 | |
FIFO [0] (FIFO [[1,2]] Empty 1 [] 0) 3 [5,4,3] 3 | |
FIFO [0] (FIFO [[1,2]] Empty 1 [[3,4,5,6]] 1) 7 [] 0 | |
FIFO [0] (FIFO [[1,2]] Empty 1 [[3,4,5,6]] 1) 7 [7] 1 | |
FIFO [0] (FIFO [[1,2]] Empty 1 [[3,4,5,6]] 1) 7 [8,7] 2 |
This file contains hidden or 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
module Propeller where | |
import qualified Data.Foldable as F | |
import Diagrams.Prelude | |
import Diagrams.Backend.SVG | |
import Diagrams.Backend.SVG.CmdLine | |
type Diag = Diagram SVG R2 | |
wave :: Double -> Double -> Diag |
This file contains hidden or 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
import Control.Arrow | |
import Control.Applicative | |
import Control.Category | |
import Prelude hiding ((.), id) | |
-- * Arrow from an applicative | |
newtype AppArrow f a b = AppArrow (f (a -> b)) | |
instance (Applicative f) => Category (AppArrow f) where |
This file contains hidden or 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
-- | Just like 'awaitForever', but adds state that is passed between | |
-- invocations of conduits. | |
awaitFold :: (Monad m) => (r -> i -> ConduitM i o m r) -> r -> Conduit i m o | |
awaitFold f = loop | |
where | |
loop r = await >>= maybe (return ()) (f r >=> mseq loop) | |
{-# INLINE awaitFold #-} | |
-- | Just like 'awaitFold', but allows premature termination of a | |
-- conduit by returning @mzero@. |
NewerOlder