Skip to content

Instantly share code, notes, and snippets.

View AndreiD's full-sized avatar
🦄
🐦

Dan Ξ AndreiD

🦄
🐦
  • in front of a screen
View GitHub Profile
@AndreiD
AndreiD / mediumx
Created December 18, 2019 21:15
mediumx
export default {
state: () => ({
loading: false
}),
mutations: {
SET_DATA(state, { id, data }) {
state[id] = data;
}
}
};
@AndreiD
AndreiD / vault-cheatsheet.md
Created November 21, 2019 19:41
hashicorp_vault_cheatsheet

Databases

vault secrets enable database

vault write database/config/my-mysql-database
plugin_name=mysql-database-plugin
connection_url="{{username}}:{{password}}@tcp(127.0.0.1:3306)/"
allowed_roles="my-role"
username="root"
password="root-password-here"

@AndreiD
AndreiD / sendRawTransaction.js
Last active November 12, 2023 15:13
Sends a raw transaction with web3 1.2.2, ethereumjs-tx, and Infura
# FOR ETHER ->
web3.eth.getTransactionCount(this.address).then(txCount => {
const txData = {
nonce: web3.utils.toHex(txCount),
gasLimit: web3.utils.toHex(100000),
gasPrice: web3.utils.toHex( YOUR_GAS_PRICE), // 10-15 gwei should be ok
to: this.toAddress,
from: this.address,
@AndreiD
AndreiD / keybase.md
Created September 13, 2019 13:07
keybase.md

Keybase proof

I hereby claim:

  • I am AndreiD on github.
  • I am andyx (https://keybase.io/andyx) on keybase.
  • I have a public key whose fingerprint is BC8A 622D 8389 31E2 8783 FCDE 3FA1 A644 AA75 5128

To claim this, I am signing this object:

@AndreiD
AndreiD / go_upload_to_cloud.go
Last active August 21, 2019 11:33
upload /download to firebase google and to AWS S3 golang
//---------- Firestore -------------
// ********* UPLOAD *******
configStorage := &firebase.Config{
StorageBucket: "xxxxxxxxxxxxxxxxx.appspot.com",
}
opt := option.WithCredentialsFile("./config/serviceAccountKey.json")
app, err := firebase.NewApp(context.Background(), configStorage, opt)
if err != nil {
log.Error(err)
@AndreiD
AndreiD / easy_crypto_html_form.html
Created July 29, 2019 13:07
easycrypto_html_form.html
<form action="https://api.easycrypto.in/charge_form" method="POST">
<input type="hidden" name="title" value="Nice Watch #1" />
<input type="hidden" name="description" value="a nice looking watch..." />
<input type="hidden" name="metadata" value="optional metadata here" />
<input type="hidden" name="local_price" value="245" />
<input type="hidden" name="local_currency" value="USD" />
<input type="hidden" name="merchant_id" value="YOUR_MERCHANT_ID" />
<input type="hidden" name="redirect_url" value="https://www.your_website.com/sucess_url" />
<input type="submit" name="submit" value="PAY WITH CRYPTO" class="buttonSubmit" />
</form>
@AndreiD
AndreiD / stablecoin.sol
Created May 22, 2019 11:16
stablecoin usdt
/**
* Source Code first verified at https://etherscan.io on Tuesday, November 28, 2017
(UTC) */
pragma solidity ^0.4.17;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
@AndreiD
AndreiD / erc20_one_file
Last active August 4, 2023 19:37
ERC20 Token One File
// File: @openzeppelin/contracts/GSN/Context.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.5;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
@AndreiD
AndreiD / fedora_setup.md
Last active December 27, 2018 08:54
fedora desktop setup

First we setup the repositories so we can install lots of stuff

sudo dnf install fedora-workstation-repositories -y

Install Rpmfusion repo

sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm -y
@AndreiD
AndreiD / poascount_ubuntu.sh
Last active November 27, 2018 11:32
poascount blockchain explorer setup ubuntu 16
#!/bin/bash
set -e
# let'em have colors
end="\033[0m"
red="\033[0;31m"
green="\033[0;32m"
echo -e "${green}......................................${end}"
echo -e "${green}........ Script Version 1.0a .........${end}"