Skip to content

Instantly share code, notes, and snippets.

Use this script to simulate transaction emmission from the M3ter Console: https://github.com/M3tering/Console

// populate.ts
import "dotenv/config";
import fs from "fs";
import setupDatabase, { saveMeter, getAllMeterRecords } from "./src/store/sqlite";
import { handleMessage } from "./src/logic/mqtt";
import { m3ter } from "./src/logic/context";

setupDatabase();
@Emmo00
Emmo00 / auto-pr.md
Last active August 21, 2025 21:06
Github Workflow to automatically create a PR whenever you Push

Been trying to make this work, you wont believe how many failed runs i had before now🙂, only to realize i only had to just enable it in my repository settings.

To allow github actions to create pull requests go to https://github.com/USERNAME/REPO_NAME/settings/actions and enable " Allow GitHub Actions to create and approve pull requests"

name: Create PR from dev to main

on:
  push:
@Emmo00
Emmo00 / Float.sol
Last active August 18, 2025 13:14
number remainder solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract Float {
uint8 public constant DECIMALS = 6;
function get(uint256 number) public pure returns (uint256 integer, uint24 reminder) {
uint256 base = 10 ** DECIMALS;
integer = number / base;
reminder = uint24(number % base);