Peter Naur's classic 1985 essay "Programming as Theory Building" argues that a program is not its source code. A program is a shared mental construct (he uses the word theory) that lives in the minds of the people who work on it. If you lose the people, you lose the program. The code is merely a written representation of the program, and it's lossy, so you can't reconstruct
Guides / Walkthroughs | |
Intro to Programming on Solana | |
https://paulx.dev/blog/2021/01/14/programming-on-solana-an-introduction/ | |
Development Tutorial by Solong | |
https://solongwallet.medium.com/solana-development-tutorial-things-you-should-know-before-structuring-your-code-807f0e2ee43 | |
Intro to Anchor Framework | |
https://project-serum.github.io/anchor/getting-started/introduction.html |
const https = require('https') | |
exports.handler = async (event) => { | |
const sns = event.Records[0].Sns.Message | |
let color = '' | |
let message = '' | |
if (sns.includes('build status is FAILED')) { | |
color = '#E52E59' | |
message = 'Release to My Company **production** failed.' | |
} else if (sns.includes('build status is SUCCEED')) { |
Around 17.06.2019 our DASH node started showing some strange behaviour. When requesting blocks from the node, their reported difficulty was around ~50x lower than the actual network.
Average Daily Dash Difficulty
|Date | Difficulty|
2019 update: this essay has been updated on my personal site, together with a followup on how to get started
2020 update: I'm now writing a book with updated versions of all these essays and 35 other chapters!!!!
If there's a golden rule, it's this one, so I put it first. All the other rules are more or less elaborations of this rule #1.
You already know that you will never be done learning. But most people "learn in private", and lurk. They consume content without creating any themselves. Again, that's fine, but we're here to talk about being in the top quintile. What you do here is to have a habit of creating learning exhaust. Write blogs and tutorials and cheatsheets. Speak at meetups and conferences. Ask and answer things on Stackoverflow or Reddit. (Avoid the walled gardens like Slack and Discourse, they're not public). Make Youtube videos
For MacOS Catalina, visit Install mysql2 on MacOS Catalina
Installing mysql2
gem errors on MacOS Mojave.
Make sure openssl
is installed on Mac via Homebrew.
// ECRECOVER implemented as a native contract. | |
type ecrecover struct{} | |
func (c *ecrecover) RequiredGas(input []byte) uint64 { | |
return params.EcrecoverGas | |
} | |
func (c *ecrecover) Run(input []byte) ([]byte, error) { | |
const ecRecoverInputLength = 128 |
// For eth_sign, we need to sign arbitrary data: | |
signMessage (withAccount, data) { | |
const wallet = this._getWalletForAccount(withAccount) | |
const message = ethUtil.stripHexPrefix(data) | |
var privKey = wallet.getPrivateKey() | |
var msgSig = ethUtil.ecsign(new Buffer(message, 'hex'), privKey) | |
var rawMsgSig = ethUtil.bufferToHex(sigUtil.concatSig(msgSig.v, msgSig.r, msgSig.s)) | |
return Promise.resolve(rawMsgSig) | |
} |
function getOriginAddress(bytes32 signedMessage, uint8 v, bytes32 r, bytes32 s) constant returns(address) { | |
bytes memory prefix = "\x19Ethereum Signed Message:\n32"; | |
bytes32 prefixedHash = keccak256(prefix, signedMessage); | |
return ecrecover(prefixedHash, v, r, s); | |
} |
const message = web3.sha3('Hello World'); | |
const signature = await web3.eth.sign(account, message); | |
const { v, r, s } = ethUtil.fromRpcSig(signature); |