Skip to content

Instantly share code, notes, and snippets.

View raf202's full-sized avatar

Raf raf202

  • Estonia
View GitHub Profile
@raf202
raf202 / baseconvert.sol
Created August 30, 2022 00:18
Solidity Convert to base
function convertToBase(uint N, uint8 base) public returns (uint) {
if (N <= 0) return 0;
uint index = 0;
uint converted = 0;
while (N >= base) {
uint remainder = N % base;
N = N / base;
converted += remainder * (10** index++);
@raf202
raf202 / serverless-cheatsheet.sh
Created March 15, 2018 23:59 — forked from jahe/serverless-cheatsheet.sh
Serverless Cheatsheet
# Create a serverless project for Node.js within AWS Lambda
serverless create --template aws-nodejs
# Create AWS credentials file in ~/.aws
serverless config credentials --provider aws --key <access-key-id> --secret <secret> --profile <profilename>
# Deploy functions from serverless.yml to AWS Lambda
sls deploy
# Invoke function