This file contains hidden or 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
const path = require('path') | |
const fs = require('fs') | |
const child_process = require('child_process') | |
const root = process.cwd() | |
npm_install_recursive(root) | |
// Since this script is intended to be run as a "preinstall" command, | |
// it will do `npm install` automatically inside the root folder in the end. | |
console.log('===================================================================') |
This file contains hidden or 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
var AWS = require('aws-sdk'); | |
async function asyncForEach(array, callback) | |
{ | |
for (let index = 0; index < array.length; index++) { | |
await callback(array[index], index, array); | |
} | |
} | |
exports.handler = async (event) => |
This file contains hidden or 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
#!/bin/bash | |
wget --quiet http://s3.amazonaws.com/ec2metadata/ec2-metadata | |
sudo chmod u+x ec2-metadata | |
INSTANCE_ID=$(./ec2-metadata | grep instance-id | awk 'NR==1{print $2}') | |
AG_NAME=$(aws autoscaling describe-auto-scaling-instances --instance-ids ${INSTANCE_ID} --query AutoScalingInstances[].AutoScalingGroupName --output text) | |
echo =================================== | |
echo Searching for cluster in ${AG_NAME} | |
echo =================================== | |
echo Local Instance ID: ${INSTANCE_ID} | |
for ID in $(aws autoscaling describe-auto-scaling-groups --auto-scaling-group-names ${AG_NAME} --query AutoScalingGroups[].Instances[].InstanceId --output text); |
This file contains hidden or 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
/** | |
* Take an array of objects of similar structure and convert it to a CSV. | |
* @source https://halistechnology.com/2015/05/28/use-javascript-to-export-your-data-as-csv/ | |
* @modifiedBy sators | |
* @param {Array} options.data Array of data | |
* @param {String} options.columnDelimiter Column separator, defaults to "," | |
* @param {String} options.lineDelimiter Line break, defaults to "\n" | |
* @return {String} CSV | |
*/ | |
export default ({data = null, columnDelimiter = ",", lineDelimiter = "\n"}) => { |
This file contains hidden or 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
<?php | |
/********* CONFIG ********/ | |
$clusterEndpoint = ""; | |
$clusterPort = 3306; | |
$clusterRegion = "us-east-1"; | |
$dbUsername = ""; | |
$dbDatabase = ""; | |
/*************************/ |
This file contains hidden or 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
<?PHP | |
$data = /** whatever you're serializing **/; | |
header('Content-Type: application/json'); | |
echo json_encode($data); |