Skip to content

Instantly share code, notes, and snippets.

View monscamus's full-sized avatar
🎯
Focusing

Alex Weinle monscamus

🎯
Focusing
View GitHub Profile
@enepomnyaschih
enepomnyaschih / base64.js
Last active November 10, 2024 11:35
https://www.npmjs.com/package/byte-base64 - Encode JS Uint8Array, simple array of bytes or native JS string to base64 and back
/*
MIT License
Copyright (c) 2020 Egor Nepomnyaschih
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@eddywashere
eddywashere / cloudwatchlogs.js
Created May 1, 2017 17:03
get cloudwatch logs
const _ = require('lodash');
const AWS = require('aws-sdk');
const retry = require('bluebird-retry');
function recursiveReq(request, params, key, items = [], count = 0) {
return request(params).then(data => {
const newItems = items.concat(data[key]);
const lastItem = _.last(newItems);
const nextToken = _.get(data, 'nextToken', null);