Skip to content

Instantly share code, notes, and snippets.

View amazingandyyy's full-sized avatar
🦄

Andy Chen amazingandyyy

🦄
View GitHub Profile
➜ minted_proto git:(update_minto_compile) ✗ prototool lint --list-linters
COMMENTS_NO_C_STYLE Verifies that there are no /* c-style */ comments.
COMMENTS_NO_INLINE Verifies that there are no inline comments.
ENUMS_HAVE_SENTENCE_COMMENTS Verifies that all enums have a comment that contains at least one complete sentence.
ENUMS_NO_ALLOW_ALIAS Verifies that no enums use the option “allow_alias”.
ENUM_FIELD_NAMES_UPPER_SNAKE_CASE Verifies that all enum field names are UPPER_SNAKE_CASE.
ENUM_FIELD_PREFIXES_EXCEPT_MESSAGE Verifies that all enum fields are prefixed with ENUM_NAME_.
ENUM_NAMES_CAMEL_CASE Verifies that all enum names are CamelCase.
ENUM_NAMES_CAPITALIZED Verifies that all enum names are Capitalized.
od -t x1 Proto2Vanilla.serializedBy.java_env
ZEIT makes global deployment accessible to everyone.
sudo wants to make secret management accessible to every ZEIT user.
ZEIT integration Hackathon 06/01-06/02: https://zeit.co/hackathon
ZEIT sudo Team: https://github.com/zeit-sudo
Github Source: https://github.com/zeit-sudo/ui
Install on ZEIT: https://zeit.co/integrations/zeit-sudo-test
# https://stackoverflow.com/questions/41573277/extract-count-of-a-string-in-log-file-using-grep
while sleep 1; do
attemps=$(grep -A 2 "KAFKA_CLIENT_PRODUCER_ATTEMPT" /srv/minted/logs/www-wsgi.log | grep -c "KAFKA_CLIENT_PRODUCER_ATTEMPT")
sent=$(grep -A 2 "KAFKA_CLIENT_PRODUCER_GOOD" /srv/minted/logs/www-wsgi.log | grep -c "KAFKA_CLIENT_PRODUCER_GOOD")
fail=$(grep -A 2 "KAFKA_CLIENT_PRODUCER_BAD" /srv/minted/logs/www-wsgi.log | grep -c "KAFKA_CLIENT_PRODUCER_BAD")
echo $sent / $attemps
done;
@amazingandyyy
amazingandyyy / System Design.md
Created January 24, 2019 04:24 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
const ethUtil = require("ethereumjs-util");
function personalSign(privateKey, msgParams) {
var message = ethUtil.toBuffer(msgParams.data)
var msgHash = ethUtil.hashPersonalMessage(message)
var sig = ethUtil.ecsign(msgHash, privateKey)
var serialized = ethUtil.bufferToHex(this.concatSig(sig.v, sig.r, sig.s))
return serialized
}
function concatSig(v, r, s) {
const rSig = ethUtil.fromSigned(r)
2004 mutiple touch -> iPhone
2008 -> Bitcoin 比特幣 -> 貨幣 $100, $500
2016 -> Ethereum 以太坊 ===> ether 以太 $300 USD
-> App -> "I love you", $5 - $50 ---> $500
2018 ======== - 比 - 較 - 好 - 用 - =========
VechainThor 唯鏈索爾 ===> vtho 索爾幣 $0.004 USD, $0.00001622 ether
* Multi Payment Protocol ->

UI To-Solve Problem

navbar Issue

  1. Right side of navbar is disordered.

Modules Issue

  1. QTUM Prediction
    1. Dont know event status when browsing
    2. after clicking, showing The betting start time has not started yet
  2. Withdraw
    1. Don’t he withdraw(can withdraw, withdrawn) status when browsing
  3. User jumping around(which is not good) QTUM Bet, Result Set, BOT Court, Finalize
const accounts = await web3.eth.getAccounts();
const instance = new web3.eth.Contract(ABI,address)
instance.methods.functionName(params).send({
from: accounts[0],
gas: '1000000'
});
async init() {
this.loading = true;
this.ui = new UiStore();
this.wallet = new WalletStore(this);
this.walletHistory = new WalletHistoryStore();
this.pubsub = new PubSubStore(this);
await this.pubsub.getSyncInfo();
runInAction(() => {
this.allEvents = new AllEventsStore(this);