Skip to content

Instantly share code, notes, and snippets.

View miohtama's full-sized avatar
🏠
https://tradingstrategy.ai

Mikko Ohtamaa miohtama

🏠
https://tradingstrategy.ai
View GitHub Profile
@miohtama
miohtama / good-pr.md
Created November 9, 2020 10:24
Good PR
@miohtama
miohtama / transaction-helper.component.ts
Created May 26, 2020 16:39
TypeScript + Angular Ethereum transaction progress bar component
import { Component, OnInit, Input, ViewChild, Output, EventEmitter } from '@angular/core';
import { Web3Service, WalletState, WalletType } from '../web3.service';
import Web3 from 'web3';
import { waitTransaction, isSuccessfulTransaction } from '../transactionwait';
import { isRequired, checkRequired } from '../requiredInput';
import { EthereumProgressBarComponent } from '../ethereum-progress-bar/ethereum-progress-bar.component';
import { Subscription } from 'rxjs';
import { NGXLogger } from 'ngx-logger';
// Called before creating a tranaction.
@miohtama
miohtama / launch.json
Created February 13, 2020 22:29
Launching Jest e2e+NestJS from Visual Studio Code - so you can hit breakpoints
// https://github.com/microsoft/vscode-recipes/tree/master/debugging-jest-tests
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Jest All",
"program": "${workspaceFolder}/node_modules/.bin/jest",
"args": [
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch user.e2e test",
"runtimeExecutable": "npm",
"cwd": "${workspaceFolder}",
"runtimeArgs": [
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch MailerLite test",
@miohtama
miohtama / main.js
Last active September 25, 2019 13:53
Ledger topping up the gas for stuck Ethereum nonce/transaction
//
// Based on https://gist.github.com/miguelmota/62559d02a1b99cb291635de4b224349c
//
const Transport = require('@ledgerhq/hw-transport-node-hid').default
// https://github.com/LedgerHQ/ledgerjs/
// https://www.npmjs.com/package/@ledgerhq/hw-app-eth
const AppEth = require('@ledgerhq/hw-app-eth').default
@miohtama
miohtama / civic-sip-client.py
Created August 28, 2018 14:26
Python client for Civic sign in and proof of identity
import base64
import datetime
import hashlib
import hmac
import json
import uuid
import logging
import time
from requests import Session
import binascii
@miohtama
miohtama / gist:93b87a963dcc7c944b5d5e6142815347
Created November 23, 2017 18:00
report of web3 sign failures
============================= test session starts ==============================
platform darwin -- Python 3.6.3, pytest-3.2.5, py-1.5.2, pluggy-0.4.0
rootdir: /Users/mikkoohtamaa/code/tm/trading.smartcontracts, inifile: setup.cfg
plugins: populus-1.11.2
collected 3 items
trading/smartcontracts/tests/test_order.py Failed signature is, number: 1 data: {'hash': '0x672e1c3f1f05f9958404b1dab1bf456af28316948a1fb08d11160b3cc2aa2eaa', 'hash_bytes': b'g.\x1c?\x1f\x05\xf9\x95\x84\x04\xb1\xda\xb1\xbfEj\xf2\x83\x16\x94\x8a\x1f\xb0\x8d\x11\x16\x0b<\xc2\xaa.\xaa', 'v': 27, 'r': HexBytes('0xa8dfdf50446708ccbca3ca72bf9d91de80510b80425e9f6b0b8a63abafad7ebb'), 's': HexBytes('0x89d58c596550d1855f361c4c294d869d3849d6e55fb1a29909d0debb599b64')}
Failed signature is, number: 14 data: {'hash': '0x7cd030aaa0481365a76e22a9a08b284f837f892adbeac43ddb4cda81550204a5', 'hash_bytes': b'|\xd00\xaa\xa0H\x13e\xa7n"\xa9\xa0\x8b(O\x83\x7f\x89*\xdb\xea\xc4=\xdbL\xda\x81U\x02\x04\xa5', 'v': 27, 'r': HexBytes('0x9b053ffcd13e05dd03b81f1094d43f8621
@miohtama
miohtama / parity.yaml
Created August 25, 2017 14:20
Parity Ansibe playbook
- name: Install dependencies
apt: name={{item}} update_cache=yes
with_items:
- software-properties-common
become: yes
- name: Install Ethereum repositories
apt_repository: repo='ppa:ethereum/ethereum'
become: yes
### Keybase proof
I hereby claim:
* I am miohtama on github.
* I am miohtama (https://keybase.io/miohtama) on keybase.
* I have a public key ASDwaisR2H0nqRfKMZtmDm_TeYoL490VnTKFIISsi_jCAwo
To claim this, I am signing this object: