Skip to content

Instantly share code, notes, and snippets.

View eira-fransham's full-sized avatar

Eira Fransham eira-fransham

  • Berlin
View GitHub Profile
Dump of assembler code for function bigint_sherlock::mul: Dump of assembler code for function bigint_sherlock::mul:
<+0>: push %rbp <+0>: push %rbp
<+1>: mov %rsp,%rbp <+1>: mov %rsp,%rbp
<+4>: sub $0x40,%rsp | <+4>: push %r15
<+8>: mov 0x10(%rbp),%rax | <+6>: push %r14
<+12>: mov 0x18(%rbp),%rcx | <+8>: push %r13
<+16>: mov 0x20(%rbp),%rdx | <+10>: push %r12
<+20>: mov 0x28(%rbp),%rsi | <+12>: push %rbx
<+24>: mov 0x30(%rbp),%r8 | <+13>: sub $0x38,%rsp
<+28>: mov 0x38(%rbp),%r9 | <+17>: mov %rdi,-0x58(%rbp)
Dump of assembler code for function bigint_sherlock::mul: Dump of assembler code for function bigint_sherlock::mul:
<+0>: push %rbp <+0>: push %rbp
<+1>: mov %rsp,%rbp <+1>: mov %rsp,%rbp
<+4>: sub $0x40,%rsp | <+4>: push %r15
<+8>: mov 0x10(%rbp),%rax | <+6>: push %r14
<+12>: mov 0x18(%rbp),%rcx | <+8>: push %r13
<+16>: mov 0x20(%rbp),%rdx | <+10>: push %r12
<+20>: mov 0x28(%rbp),%rsi | <+12>: push %rbx
<+24>: mov 0x30(%rbp),%r8 | <+13>: sub $0x38,%rsp
<+28>: mov 0x38(%rbp),%r9 | <+17>: mov %rdi,-0x58(%rbp)
import XMonad
import XMonad.Actions.CycleWS
import XMonad.Actions.UpdatePointer
import XMonad.Hooks.ManageDocks
import XMonad.Hooks.ManageHelpers
import XMonad.Layout.Fullscreen
import XMonad.Layout.NoBorders
import XMonad.Layout.BorderResize
import XMonad.Layout.Minimize
import XMonad.Layout.BinarySpacePartition

How to get a JSON wallet from MetaMask

Unfortunately, MetaMask does not support the option to export your key in JSON format. The following guide will show you a workaround on how to do it.

Step 1

Go on the MetaMask browser extension and click the three-dotted settings icon.

Main screen

Click on ‘Export Private Key’, confirm with your password and ‘Export as file’. You will download your private key as a CSV file.

x/(x+1) - (x+1)/(x+2)
= (x+2)x/(x+1)(x+2) - (x+1)(x+1)/(x+1)(x+2)
= ((x^2 + 2x) - (x^2 + 2x + 1))/(x+1)(x+2)
= 1/(x+1)(x+2)
// Low-level interface, we can implement a higher-level interface as a library
mod pwasm {
use std::marker::PhantomData;
pub struct ContractDef<State> {
state: State,
iterate: for<'a> fn(&'a EthEnv, State, MessageData) -> (State, ReturnData),
}
// Will it ever be possible to get arbitrary blocks?
@eira-fransham
eira-fransham / __use.rs
Last active May 7, 2018 11:45
Comparison of assembly for a simple case
pub fn disassemble() {
let smallvec: SmallVec<[_; 16]> = smallvec![10; 100];
test::black_box(smallvec);
}
#[macro_use]
extern crate combine;
use std::collections::HashMap;
#[derive(Debug, Clone)]
enum Ast {
Lit(Value),
Variable(String),
Call(Box<Ast>, Vec<Ast>),
pub struct VecBuilder<'a, T: 'a> {
inner: *mut Vec<T>,
_marker: std::marker::PhantomData<&'a mut Vec<T>>,
}
impl<'a, T> VecBuilder<'a, T> {
pub fn new(v: &'a mut Vec<T>) -> Self {
VecBuilder {
inner: v,
_marker: Default::default(),
use std::{str, mem, ptr, slice};
use std::ops::Deref;
pub struct CowStr<'a>(CowVec<'a, u8>);
impl<'a> CowStr<'a> {
#[inline]
pub fn borrowed(b: &'a str) -> Self {
CowStr(CowVec::borrowed(b.as_bytes()))
}