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
- (void)handlePinch:(UIPinchGestureRecognizer *)recognizer { | |
if (UIGestureRecognizerStateBegan == recognizer.state || | |
UIGestureRecognizerStateChanged == recognizer.state) { | |
// Use the x or y scale, they should be the same for typical zooming (non-skewing) | |
float currentScale = [[recognizer.view.layer valueForKeyPath:@"transform.scale.x"] floatValue]; | |
// Variables to adjust the max/min values of zoom | |
float minScale = 0.7; | |
float maxScale = 2.0; |
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
Verificare accesso al repository npm registry desiderato (esempio: http://npmregistry.ideasolutions.it/) | |
Da terminale nella cartella del progetto, aggiungere un file .npmrc dove all'interno c'è l'indirizzo del registry: | |
Esempio: @sgtv:registry=http://npmregistry.ideasolutions.it | |
Da terminale aggiungere l'account npm adduser --registry {indirizzo} | |
in fase di registrazione usare la mail senza @ sostituendola con .. | |
per pubblicare: npm publish {nomeProgetto} --registry {indirizzo} |
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
https://rtyley.github.io/bfg-repo-cleaner/ | |
clone del progetto: `git clone --mirror git://example.com/some-big-repo.git` | |
dentro questa cartella copiare il file java bfg | |
da terminale | |
`java -jar bfg-1.13.0.jar --delete-files sample.ts` | |
dopo bisogna: |
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
Per effettuare un attacco: | |
`vegeta attack -duration=5s -rate=10 -targets='input.txt' | tee resultsUser.bin` | |
o semplicemente: | |
`vegeta attack -duration=5s -rate=2 -targets='input.txt' | vegeta report` (per visualizzare direttamente il report) | |
il file input.txt sarà cosi (per efficienza scegliere solo una richiesta) | |
``` | |
GET https://gxldsc0bij.execute-api.eu-west-1.amazonaws.com/dev/subjects&includeLikingSessions=true |
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 | |
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
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
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
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
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) { |
OlderNewer