Skip to content

Instantly share code, notes, and snippets.

View DeRain's full-sized avatar
🏠
Working from home

Kirill Beresnev DeRain

🏠
Working from home
View GitHub Profile
@DeRain
DeRain / sign-tx.html
Created July 29, 2020 21:53
Sign transaction without sending via Metamask
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Metamask sign tx poc</title>
</head>
<body>
<button class="enableEthereumButton btn" type="button">Enable Ethereum</button>
<button class="sendEthButton btn" type="button">Sign Transaction</button>
<p>Signed transaction:</p>

FWIW: I didn't produce the content presented here (the outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?

My account address is: 0x7bb3B0E8A59f3f61d9Bff038f4AEb42cAE2ECce8
My account bech32 address is: zil10wemp699nulkrkdl7qu0ft459jhzan8g6r5lh7
Your account balance is:
{ balance: '1000000000000000000', nonce: 0 }
Current Minimum Gas Price: 1
My Gas Price 1000000000
Is the gas price sufficient? true
Sending a payment transaction to the network...
The transaction status is:
{ cumulative_gas: 1, epoch_num: '1', success: true }
const {BN, Long, bytes, units} = require('@zilliqa-js/util');
const {Zilliqa} = require('@zilliqa-js/zilliqa');
const {
toBech32Address,
getAddressFromPrivateKey,
} = require('@zilliqa-js/crypto');
const zilliqa = new Zilliqa('http://127.0.0.1:5555');
// These are set by the core protocol, and may vary per-chain.
### Keybase proof
I hereby claim:
* I am derain on github.
* I am derain (https://keybase.io/derain) on keybase.
* I have a public key ASBjR0eGQCddGAtVR-PrOQgBkQ7RRdMfAo9E10cdduQlZgo
To claim this, I am signing this object:
@DeRain
DeRain / Darkula.itermcolors
Created October 8, 2018 11:39 — forked from poma/Darkula.itermcolors
Darkula theme for iTerm 2 from JetBrains IntelliJ IDEA
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.19522881507873535</real>
@DeRain
DeRain / tls_ca_generate.sh
Last active September 19, 2018 11:24
Self-signed CA and TLS certificates generator
TMPDIR="$(pwd)/tls"
# Optional: Ensure the target directory exists and is empty.
rm -rf "${TMPDIR}"
mkdir -p "${TMPDIR}"
cat > "${TMPDIR}/openssl.cnf" << EOF
[req]
default_bits = 2048
encrypt_key = no
@DeRain
DeRain / ImportProductsCommand.php
Created April 27, 2018 17:20 — forked from nicanaca0/ImportProductsCommand.php
Simple CSV Product importer for Sylius. Includes the product, the variant, channel pricing, taxons images and associations (1.0.0-beta.2)
<?php
namespace AppBundle\Command;
use Sylius\Component\Core\Model\ChannelPricingInterface;
use Sylius\Component\Core\Model\ProductInterface;
use Sylius\Component\Core\Model\ProductVariantInterface;
use Sylius\Component\Product\Model\ProductAssociationInterface;
use Sylius\Component\Product\Model\ProductAssociationTypeInterface;
use Sylius\Component\Taxonomy\Model\TaxonInterface;
@DeRain
DeRain / example.sh
Created November 27, 2017 16:55
Generate .env file from AWS Parameters Store
#Add ENV strings into AWS Parameter Store (as one parameter). All strings will be separated by the newline
#We are getting ENV string separated by the newline and pub them in the dotenv
aws ssm get-parameter --name Param-with-env --region eu-west-1 --query Parameter.Value | sed -e 's/^"//' -e 's/"$//' | awk '{gsub(/\\n/,"\n")}1' >> .env
@DeRain
DeRain / gist:c727b4a78f9f8e2bf31581636b6bbe4b
Created March 23, 2017 13:02 — forked from zdne/gist:5f8295642af18aff27ec
Working with multiple API Blueprint files

Working with multiple blueprint files

This document describes 4 different solutions to work APIs that consist of multiple blueprint files. Every of this solution work with all Apiary.io features but editing. To edit a blueprint you have to do it outside of Apiary as Apiary editor does not support working with multiple files. In other words if you are using one of the solutions below avoid editing the blueprint in Apiary.

1. Hercule

Hercule is a CLI tool written in Node.js – available as an NPM package. It uses markdown referencing and linking syntax to transclude other files into a blueprint file. This solution is universal and would work with any Markdown files not just API Blueprint.

The major benefit – unlike any other solutions here – is also that the references are rendered as HTML links in any Markdown editor so the result is HTML that can be browsed!