Skip to content

Instantly share code, notes, and snippets.

View ascjones's full-sized avatar

Andrew Jones ascjones

View GitHub Profile
$ git clone http://code.hledger.org hledger
$ cd hledger
$ stack build hledger
$ stack ghc extra/hledger-rewrite.hs
$ mv extra/hledger-rewrite ~/.local/bin
$ cd ..
$ hledger-rewrite --help
hledger-rewrite [OPTIONS] [PATTERNS] --add-posting "ACCT AMTEXPR" ...
print all journal entries, with custom postings added to the matched ones
@RobBlackwell
RobBlackwell / configuration.nix
Last active September 7, 2024 16:48
NixOS on Dell XPS 13
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
@i-am-tom
i-am-tom / ZipRecord.purs
Created August 31, 2017 20:00
ZipRecord for PureScript. More notes from RowToList studies.
module Main (main, zip, zipRecord, class ZipRowList) where
-- | After Tuesday's experiments, let's move onto a slightly more
-- | interesting example. Last time, I confess, I cheated a bit to
-- | avoid getting too deep into RowToList stuff. Today, I'm not
-- | going to cheat, and get riiiight into it. When we're thirty lines
-- | in, don't say you weren't warned!
import Prelude (($), discard, Unit)
import Control.Monad.Eff (Eff)
/**
* @dev OpcodeChecker processes contract code to generate a bitmap of used opcodes.
*
* DO NOT USE: See the vulnerability identified by Recmo below. A patch will be provided soon.
*
* The generated bitmap can be used to enforce whitelisting and blacklisting on contract code.
* Bit n of the bitmap is set iff opcode n is used. For instance, the presence of the STOP opcode
* will result in bit 0 of the bitmap being set.
*
* A best-effort attempt is made to skip over unreachable data, but there may be false positives.