Skip to content

Instantly share code, notes, and snippets.

@frangio
frangio / Pausable.sol
Last active February 2, 2023 19:06
Lightweight explicit state machines in Solidity.
// SPDX-License-Identifier: MIT
pragma solidity 0.8.16;
import "./StateMachines.sol";
contract Pausable is StateMachines {
StateMachine m = initial("unpaused");
event Paused(bool paused);
@Surendrajat
Surendrajat / elementaryos.md
Last active December 2, 2021 21:16 — forked from suberb/elementaryos.md
elementaryOS | Things I Do After Installing elementary OS Hera

First Things First

  • Enable PPA

     sudo apt update
     sudo apt install software-properties-common apt-transport-https curl
  • Install apt-fast [Yes! it's really fast]

@beugley
beugley / s3_get.py
Last active December 4, 2021 14:58
Python boto3 script to download an object from AWS S3 and decrypt on the client side using KMS envelope encryption
#!/usr/bin/env python
###############################################################################
# This script downloads an object from AWS S3. If the object was encrypted,
# it will be decrypted on the client side using KMS envelope encryption.
#
# Envelope encryption fetches a data key from KMS and uses it to encrypt the
# file. The encrypted file is uploaded to an S3 bucket along with an encrypted
# version of the data key (it's encrypted with a KMS master key). You must
# have access to the KMS master key to decrypt the data key and file. To
# decrypt, the file is downloaded to the client, the encrypted data key is
@kristopherjohnson
kristopherjohnson / LowPassFilterSignal.swift
Last active June 10, 2024 05:30
Simple implementation of low-pass filter
struct LowPassFilterSignal {
/// Current signal value
var value: Double
/// A scaling factor in the range 0.0..<1.0 that determines
/// how resistant the value is to change
let filterFactor: Double
/// Update the value, using filterFactor to attenuate changes
mutating func update(newValue: Double) {