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
/* | |
Usage | |
----- | |
$ npm init | |
$ npm install axios | |
Replace variables "token", "smartsheetId" and "payload" | |
$ node smartsheet_column_mapper.js |
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
### Keybase proof | |
I hereby claim: | |
* I am rproenca on github. | |
* I am proenr (https://keybase.io/proenr) on keybase. | |
* I have a public key ASDlJxkD5QtJUszTbPVNFaCwDhaqM4_uqUo6VJNpJAkSPAo | |
To claim this, I am signing this object: |
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
const getRandomString = length => { | |
let s = ''; | |
do { | |
s += Math.random() | |
.toString(36) | |
.substring(2); | |
} while (s.length < length); | |
s = s.substr(0, length); |
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
cat input.json | jq -r '(map(keys) | add | unique) as $cols | map(. as $row | $cols | map($row[.])) as $rows | $cols, $rows[] | @csv' > output.csv |
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
#!/bin/bash | |
# This script updates Azure Vault network ACLs given list of IP Addresses in CIDR format | |
VAULT_NAME=$1; # Vault name | |
INPUT_FILENAME=cidr_list.txt | |
if [ -z $VAULT_NAME ] | |
then | |
printf "Incorrect usage. Please use: ./update.sh [vault_name]\n"; |
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
#!/bin/bash | |
# Generates a list of CIDRs given an Azure IP Ranges JSON file | |
# https://www.microsoft.com/en-us/download/confirmation.aspx?id=56519 | |
INPUT_FILENAME=$1; # Name of the JSON file downloaded from MS website (ServiceTags_Public_YYYYMMDD.json) | |
OUTPUT_FILENAME=cidr_list.txt | |
if [ -z $INPUT_FILENAME ] | |
then |
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
const AWS = require('aws-sdk'); | |
const {parallelScan} = require('@shelf/dynamodb-parallel-scan'); | |
const TABLE_NAME = '[table-name]'; | |
const PRIMARY_PARTITION_KEY = '[partition-key]'; | |
async function fetchAll() { | |
const CONCURRENCY = 250; | |
const alias = `#${PRIMARY_PARTITION_KEY}`; | |
const name = PRIMARY_PARTITION_KEY; |
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
const fetch = require('node-fetch') | |
const pipe = require('p-pipe') | |
const { table } = require('table') | |
async function fetchDogs(dogs) { | |
const promises = dogs.map(async function (dog) { | |
const response = await fetch(`https://dog.ceo/api/breed/${dog}/images/random/1`) | |
const data = await response.json() | |
return { | |
[dog]: data.message |
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
const fetch = require('node-fetch') | |
async function fetchDogsImagesSequential(dogs) { | |
const images = [] | |
for (const dog of dogs) { | |
const response = await fetch(`https://dog.ceo/api/breed/${dog}/images/random/3`) | |
const data = await response.json() | |
images.push({ |
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
window.Clipboard = (function(window, document, navigator) { | |
var textArea, | |
copy; | |
function isOS() { | |
return navigator.userAgent.match(/ipad|iphone/i); | |
} | |
function createTextArea(text) { | |
textArea = document.createElement('textArea'); |
NewerOlder