Skip to content

Instantly share code, notes, and snippets.

@mariogemoll
mariogemoll / check_endianness.c
Created February 4, 2019 15:20
Check endianness
#include <stdio.h>
int main()
{
unsigned int i = 0xaabbccdd;
printf("Value: %x\n", i);
unsigned char * i_ptr = &i;
for (int x=0; x < 4; x++) {
printf("\nAddress: %u\n", i_ptr+x);
@mariogemoll
mariogemoll / extract_empty_step_info.js
Created October 12, 2018 14:27
Extract EmptyStep info from block
const rlp = require('rlp')
const util = require('ethereumjs-util')
// Response from eth_getBlockByNumber JSONRPC call
const response = require('./response.json')
const block = response.result
const parentHash = Buffer.from(block.parentHash.substr(2), 'hex')
const emptySteps = rlp.decode(block.sealFields[2])
-- Adapted from http://macscripter.net/viewtopic.php?id=39166
-- choose the folder with the notes
set notesFolder to choose folder
-- find al the files in that folder
tell application "Finder"
set noteFiles to (files of entire contents of notesFolder) as alias list
end tell