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 userData = { | |
name: "John Doe", | |
email: "john.doe@tdd.com", | |
superSecretKey: "JOHNDOESECRETKEY" | |
} | |
const { superSecretKey, ...secureData } = userData; | |
console.log(secureData); |
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/sh | |
EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')" | |
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" | |
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")" | |
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ] | |
then | |
>&2 echo 'ERROR: Invalid installer checksum' | |
rm composer-setup.php |
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
dys8.jest-snippets | |
christian-kohler.npm-intellisense | |
christian-kohler.path-intellisense | |
CoenraadS.bracket-pair-colorizer | |
dbaeumer.vscode-eslint | |
esbenp.prettier-vscode | |
formulahendry.auto-rename-tag | |
glitch.glitch | |
JamesBirtles.svelte-vscode | |
joelday.docthis |
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 https = require("https"); | |
https.get("https://coderbyte.com/api/challenges/json/age-counting", (resp) => { | |
resp.setEncoding("utf-8"); | |
let data = ""; | |
// parse json data here... | |
resp.on("data", (d) => { | |
data += [d]; | |
}); |
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
function camelize(str) { | |
let _str = str.toLowerCase(); | |
var finalResult = _str.charAt(0).toUpperCase() + _str.slice(1); | |
return finalResult.replace(/\W+(.)/g, function (match, chr) { | |
return chr.toUpperCase(); | |
}); | |
} | |
console.log(camelize("cats AND*Dogs-are Awesome")); |
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
var AWS = require('aws-sdk'); | |
AWS.config.region = 'us-west-2'; | |
exports.handler = function(event, context) { | |
console.log("\n\nLoading handler\n\n"); | |
var sns = new AWS.SNS(); | |
sns.publish({ | |
Message: 'Test publish to SNS from Lambda', | |
TopicArn: 'TOPIC_ARN' |
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
echo "Extracting 2000 rows at a time" | |
split -l 2000 sheet.csv | |
echo "converting extracted files to csv format" | |
for i in *; do mv "$i" "$i.csv"; done |
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
var AWS = require('aws-sdk'); | |
AWS.config.update({region: 'us-east-1'}); | |
exports.handler = function (e, ctx, callback) { | |
var params = { | |
TableName: '<tablename>', | |
Item: 'table column data goes here' | |
}; |
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
# this shell script is used to clean up the cache of any heroku app listed below | |
echo "Enter the name of the heroku app that you would like to clear(make sure app name is the same as it is on heroku)." | |
read INPUT_STRING | |
heroku repo:gc --app $INPUT_STRING | |
heroku repo:purge_cache --app $INPUT_STRING | |
echo | |
echo |
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
// add this in you Browserstack config files | |
beforeSession: function (config, capabilities, specs) { | |
capabilities.name = specs && specs[0].split('/').pop() || undefined; | |
} |
NewerOlder