#GIT
- Modificado (modified);
- Preparado (staged/index)
- Consolidado (comitted);
import org.springframework.amqp.core.Binding; | |
import org.springframework.amqp.core.BindingBuilder; | |
import org.springframework.amqp.core.DirectExchange; | |
import org.springframework.amqp.core.Queue; | |
import org.springframework.amqp.rabbit.connection.ConnectionFactory; | |
import org.springframework.amqp.rabbit.core.RabbitTemplate; | |
import org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer; | |
import org.springframework.amqp.rabbit.listener.adapter.MessageListenerAdapter; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; |
private ObjectMapper jsonMapper = new ObjectMapper(); | |
private ExecutorService executorService = Executors.newFixedThreadPool(5); | |
@Async | |
public ListenableFuture<Boolean> export(UUID customerId) { | |
try (PipedInputStream in = new PipedInputStream(); | |
PipedOutputStream pipedOut = new PipedOutputStream(in); | |
GZIPOutputStream out = new GZIPOutputStream(pipedOut)) { | |
Stopwatch stopwatch = Stopwatch.createStarted(); |
import { | |
AfterContentInit, Directive, ElementRef, EventEmitter, Inject, Input, OnDestroy, Output, PLATFORM_ID, | |
Renderer2 | |
} from "@angular/core"; | |
import {isPlatformBrowser} from "@angular/common"; | |
@Directive({ | |
selector: '[image-loader]' | |
}) | |
export class ProgressiveImageLoaderDirective implements AfterContentInit, OnDestroy { |
@RequestMapping(value = "/runJobAndGetLogs", method = RequestMethod.GET) | |
public ResponseEntity<StreamingResponseBody> runJobAndGetLogs() throws IOException { | |
final InputStream inputStream = someService.runJobAndGetReportProgress(); | |
StreamingResponseBody body = StreamingResponseBody body = (outputStream) -> { | |
try (BufferedInputStream br = new BufferedInputStream(inputStream)) { | |
// just copying to the outputstream | |
byte[] contents = new byte[1024]; | |
int bytesRead = 0; | |
while ((bytesRead = br.read(contents)) != -1) { |
<?xml version="1.0" encoding="UTF-8"?> | |
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"> | |
<persistence-unit name="h2" transaction-type="JTA"> | |
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider> | |
<properties> | |
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect" /> | |
<property name="hibernate.connection.driver_class" value="org.h2.Driver" /> | |
<property name="hibernate.hbm2ddl.auto" value="update" /> |
# https://developer.spotify.com/console/get-current-user-saved-tracks | |
$token="<Your Token>" | |
# API limits 50 tracks per request, so I paginate my 1100+ musics here | |
for i in `seq 0 50 1300`; | |
do curl -k -X "GET" "https://api.spotify.com/v1/me/tracks?limit=50&offset=$i" -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer $token" >> musics.json; | |
done; |
#!/bin/bash | |
set -o errexit # Exit on error | |
git stash save 'Before deploy' # Stash all changes before deploy | |
git checkout deploy | |
git merge master --no-edit # Merge in the master branch without prompting | |
npm run build # Generate the bundled Javascript and CSS | |
if $(git commit -am Deploy); then # Commit the changes, if any | |
echo 'Changes Committed' | |
fi | |
git push heroku deploy:master # Deploy to Heroku |
#!/bin/sh | |
# Source: https://github.com/pilhuhn/microprofile-demo/blob/mpm-2.0-testing/parallel_count_traffic_generator.sh | |
#set -x | |
while true | |
do | |
END=$((RANDOM % 10 +1 )) | |
echo $END | |
for i in `seq $END` |
## Cluster | |
### Cluster info | |
kubectl cluster-info | |
kubectl get nodes | |
kubectl describe node | |
### Listar os eventos | |
kubectl get events |