This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function signMessage(message) { | |
await web3.personal.sign(args...); | |
} | |
async function signPayment(contractAddress, amount) { | |
var message = constructPaymentMessage(contractAddress, amount); | |
var signed = await signMessage(message); | |
} | |
signPayment(args...) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Knapsack algorithm | |
//================== | |
// wikipedia: [Knapsack (0/1)](http://en.wikipedia.org/wiki/Knapsack_problem#0.2F1_Knapsack_Problem) | |
// Given a set `[{weight:Number, benefit:Number}]` and a capacity, | |
// find the maximum value possible while keeping the weight below | |
// or equal to the capacity | |
// **params**: | |
// `capacity` : Number, | |
// `items` : [{w:Number, b:Number}] | |
// **returns**: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias "smoke" "dota_shop_force_hotkeys 1;toggleshoppanel;shop_nav_to_tab 0;shop_select_itemrow 5;toggleshoppanel;dota_shop_force_hotkeys 0" | |
bind F3 "smoke" | |
alias "obs" "dota_shop_force_hotkeys 1;toggleshoppanel;shop_nav_to_tab 0;shop_select_itemrow 10;toggleshoppanel;dota_shop_force_hotkeys 0" | |
bind F1 "obs" | |
alias "sents" "dota_shop_force_hotkeys 1;toggleshoppanel;shop_nav_to_tab 0;shop_select_itemrow 11;toggleshoppanel;dota_shop_force_hotkeys 0" | |
bind F2 "sents" | |
alias "dust" "dota_shop_force_hotkeys 1;toggleshoppanel;shop_nav_to_tab 0;shop_select_itemrow 7;toggleshoppanel;dota_shop_force_hotkeys 0" |