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
# DynamoDb Local Serverless | |
[https://www.npmjs.com/package/serverless-dynamodb-local](url) | |
`sls dynamodb install && sls dynamodb start --migrate` | |
# DynamoDB admin console | |
[https://www.npmjs.com/package/dynamodb-admin](url) | |
`DYNAMO_ENDPOINT=http://localhost:8000 dynamodb-admin --port 8000` |
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
REBUILD SPOTLIGHT | |
sudo mdutil -E / | |
https://blog.supereasyapps.com/how-to-fix-spotlight-search-on-mac-spotlight-search-not-showing-apps/ | |
TextEdit Open default new | |
defaults write -g NSShowAppCentricOpenPanelInsteadOfUntitledFile -bool false |
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
import 'dart:html'; | |
import 'dart:convert'; | |
import 'package:crypto/crypto.dart'; | |
void main() { | |
String secret = 'secret'; | |
String message = 'Message'; | |
List<int> secretBytes = utf8.encode(secret); |
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
download https://rtyley.github.io/bfg-repo-cleaner/ | |
clone `git clone --mirror git://example.com/some-repo.git` | |
if your files to delete are in the last "master" commit, delete the file and push | |
. | |
The last master commit is always preserved so you need to make another commit. | |
then `bfg --delete-files filename.txt my-repo.git` | |
my-repo.git is the name in your folder |
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
import readline from 'readline' | |
import fs from 'fs' | |
fs.writeFileSync('./output.txt', '', {flag: 'w'}) | |
const readInterface = readline.createInterface( | |
fs.createReadStream('./folder/list.html'),process.stdout | |
); | |
readInterface.on('line', function(line) { |
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
cd dynamoLocalDirectory | |
# run the java command | |
java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -sharedDb | |
#don't close this terminal, open another window | |
#create the table using a json file | |
aws dynamodb create-table | |
--cli-input-json file:///Users/davidericci/Projects/meteosuper-api/localDynamo/create-forecastTable.json | |
--endpoint-url http://localhost:8000 | |
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
Create a LightSail instance | |
During creation, remember to change the region | |
when using a specific region a private key will be created | |
download the key | |
you can use the `ssh -i path/to/key user@host` | |
or you can add the private key (without the .pem extension) inside your .ssh folder, then | |
edit the config file with the user, url and path to the private key | |
to copy a file into lightsail, do not log into ssh, but use `scp /path/to/file user@host:./path/where/to/copy` |
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
FROM | |
The base image for building a new image. This command must be on top of the dockerfile. | |
MAINTAINER | |
Optional, it contains the name of the maintainer of the image. | |
RUN |
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
let string = ''; | |
let counter = 0; | |
const start = async () => { | |
await Promise.all(data.Contents.map(async element => { | |
string += await someAsyncFunc(element); | |
console.log('Counter: ' + counter); | |
counter++; | |
})) | |
console.log('Finishing'); | |
doSomethingAfterThat(string); |
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
tar xvzf file.tar.gz | |
wget https://github.com/tsenart/vegeta/releases/download/cli%2Fv12.2.1/vegeta-12.2.1-linux-amd64.tar.gz | |
ssh-add -K /Users/username/Downloads/LightsailDefaultPrivateKey-us-east-2.pem | |
scp /path/to/file username@address:path/to/destination/filename (add all the path, even the file name) | |
ssh user@url | |
NewerOlder