Skip to content

Instantly share code, notes, and snippets.

View itoonx's full-sized avatar
👻
Deep

Makkhawan Voraboot itoonx

👻
Deep
View GitHub Profile
@itoonx
itoonx / improved-lnd-bitcoind-install.md
Created January 28, 2018 07:09 — forked from bretton/improved-lnd-bitcoind-install.md
updated & improved guide to installing LND, Bitcoind, on Ubuntu 16.04 Server on testnet
{
"config": {
"chainId": 15,
"homesteadBlock": 0,
"eip155Block": 0,
"eip158Block": 0
},
"difficulty": "200000000",
"gasLimit": "2100000",
"alloc": {
@itoonx
itoonx / gist:ee8f72c3393914cbb86122e2e0ddfef6
Created February 21, 2018 04:48
Please check your gas amount : may be misleading
I just started learning solidity development, and when I started writing my own Smart Contract - I came across this error.
Error encountered, bailing. Network state unknown. Review successful transactions manually.
Error: The contract code couldn't be stored, please check your gas amount.
truffle compile worked OK, but truffle migrate gave this error.
Usually, it is said that is there is a loop (infinite loop, due to logic error) one usually "runs out of gas"
If you purely look at the error, it seems "logical" i.e. there is no compilation error, but when deploying the smart contract you "ran out of gas"
@itoonx
itoonx / gist:ddccbab95f2f3babf4faf5ae3babc468
Created March 2, 2018 14:56
Nginx - redirect http to https
server {
listen 80;
server_name www.domain.com domain.com;
# redirects both www and non-www to ssl port with http (NOT HTTPS, forcing error 497)
return 301 http://domain.com$request_uri;
}
server {
listen 433 ssl http2 default_server;
@itoonx
itoonx / gist:5716a9acac354b1dd0a6541eae3eb647
Created March 2, 2018 23:04
Example for handle job to every 5 minute
<?php
namespace App\Jobs;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Carbon\Carbon;
<?php
namespace App\Events;
use Illuminate\Broadcasting\Channel;
use Illuminate\Queue\SerializesModels;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Broadcasting\InteractsWithSockets;
@itoonx
itoonx / gist:f616e81c5971b694dea31fec4b2b8cb9
Created March 6, 2018 05:55
Etherscan Verification Task
Fill in the Token Update Request Form
Note: Your request might not be processed if it violates any of the following:
1. Safe-to-visit website
2. Clear and concise information about project/token on the website
* Requester Name
* Requester Email Address
* Contract Address
* Official Site URL
@itoonx
itoonx / gist:5acc05505d9f5115b3da6cb98b3fc41c
Created March 25, 2018 17:40
Ethereum Bytecode and OPCODE
76
down vote
accepted
All of the opcodes and their complete descriptions are available in the Ethereum Yellow paper. For convenience, though, I've made a handy reference list of them all:
0s: Stop and Arithmetic Operations
0x00 STOP Halts execution
0x01 ADD Addition operation
A nonce is just a sequential number tied to every transaction that represents the number of transactions the sender account has made on the network. You can think of it the same way as the auto-incrementing id field in a SQL database. It's a mechanism to ensure that the same transaction isn't submitted twice.
Example: You create a brand new Ethereum account. Your friend Alex sends you 5 ETH. This doesn't effect your account's nonce because you weren't the sender account. You then send 1 ETH to your friend John. The transaction that sends that 1 ETH needs to have the nonce of 0, because it's the first transaction your account is sending. Later that day, you send 2 ETH to your friend Bradley. That transaction will need to have a nonce of 1.
If you're going to set the nonce programmatically in a Dapp you can do it with web3 like this web3.eth.getTransactionCount(acct) because the number of transactions that an account has sent, will be the next nonce that it needs to use.
To proactively answer your next quest
### Keybase proof
I hereby claim:
* I am itoonx on github.
* I am itoonx (https://keybase.io/itoonx) on keybase.
* I have a public key ASAlFuih3VbTCmM3EPJZe3vdDjBPA9e78yS1a5KBLOm4Uwo
To claim this, I am signing this object: