module.exports = {
presets: [
[
/**
* We don't care about the these useless options as they aren't needed.
*
* https://babeljs.io/docs/babel-preset-env#bugfixes
* https://babeljs.io/docs/babel-preset-env#spec
* https://babeljs.io/docs/babel-preset-env#loose
* Nel | |
*Csp | |
*Health | |
*Version | |
*Req id | |
* Timing | |
* Problems | |
Csche control | |
Etag | |
Cors |
I recently needed a blazing fast concurrent to fetch items from an API. Of course, I could use a combination of async-awaits and some cryptic code with promises and so I took a stab at doing this in rxjs.
import { Observable } from 'rxjs';
export function doPaginate<T>(
fetchPage: (page: number) => Promise<{ totalRows: number; resultItems: T[] }>,
): Observable<T> {
The following is an altenative way to do dependency analysis for Node projects but using SQL.
Note
This project is not intended to be comprehensive by any means but is simply a demonstration of what is possible.
The approach centers around reading the dependency tree using the the output of the npm ls
command and loading it
into SQLite.
I recently needed to use a Node-based Lambda where it depended on an NPM module.
I didn't wan't to begin using a bundler, switch runtimes or do any workarounds. I just needed to get this custom resource up and running.
Note
I'm not sure whether this whole approach is overkill and could be better accomplished by using URL-based imports.
#!/bin/bash | |
aws emr describe-cluster --cluster-id @1 | jq --raw-output '.Cluster .MasterPublicDnsName | sub("ip-(?<ip1>[0-9]*)-(?<ip2>[0-9]*)-(?<ip3>[0-9]*)-(?<ip4>[0-9]*).*$"; "\(.ip1).\(.ip2).\(.ip3).\(.ip4)")' |
aws emr create-cluster --auto-scaling-role production-emr-auto-scaling --applications Name=Hadoop Name=Hive Name=Spark --bootstrap-actions '[{"Path":"s3://nosto-emr-bootstrap/sshkeys.sh","Name":"Add ssh keys"}]' --ebs-root-volume-size 20 --ec2-attributes '{"KeyName":"mridang","InstanceProfile":"production-emr","ServiceAccessSecurityGroup":"sg-025cd99e844eb8ee9","SubnetId":"subnet-de214af5","EmrManagedSlaveSecurityGroup":"sg-0548dc804984f9cf8","EmrManagedMasterSecurityGroup":"sg-0f5fc3a1f9be29054"}' --service-role production-emr-service --enable-debugging --release-label emr-6.2.0 --log-uri 's3://nosto-emr-logs/' --name 'MridangTest' --instance-groups '[{"InstanceCount":1,"EbsConfiguration":{"EbsBlockDeviceConfigs":[{"VolumeSpecification":{"SizeInGB":32,"VolumeType":"gp2"},"VolumesPerInstance":2}]},"InstanceGroupType":"CORE","InstanceType":"c5a.xlarge","Name":"Core - 2"},{"InstanceCount":1,"EbsConfiguration":{"EbsBlockDeviceConfigs":[{"VolumeSpecification":{"SizeInGB":32,"VolumeType":"gp2"},"VolumesPerInstance |
#!/bin/sh | |
| |
sha=$(shasum -b "$1" | awk '{print $1}') | |
url="https://search.maven.org/solrsearch/select?q=1:%22${sha}%22&rows=1&wt=json" | |
if curl -s -o json -L "$url"; then | |
gav=$(jq -r '.response.docs[0].g + ":" + .response.docs[0].a + ":" + .response.docs[0].v' json) | |
if [ "$gav" != "null" ]; then | |
cat gav | |
fi | |
rm -f json |
install coreutils | |
install findutils --with-default-names | |
install gnu-indent --with-default-names | |
install gnu-sed --with-default-names | |
install gnutls | |
install grep --with-default-names | |
install gnu-tar --with-default-names | |
install gawk | |
install tree | |
install icdiff |
package com.mridang.dashbar; | |
import android.graphics.Bitmap; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.Paint; | |
import android.graphics.PorterDuff; | |
import android.graphics.PorterDuffXfermode; | |
import android.graphics.Typeface; | |
import android.os.Environment; |