#GIT
- Modificado (modified);
- Preparado (staged/index)
- Consolidado (comitted);
var http = require("http"), | |
url = require("url"), | |
path = require("path"), | |
fs = require("fs") | |
port = process.argv[2] || 8888; | |
http.createServer(function(request, response) { | |
var uri = url.parse(request.url).pathname | |
, filename = path.join(process.cwd(), uri); |
@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) { |
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 { |
First of all, please note that token expiration and revoking are two different things.
A JWT token that never expires is dangerous if the token is stolen then someone can always access the user's data.
Quoted from JWT RFC:
A complete list of RxJS 5 operators with easy to understand explanations and runnable examples.
I've been working with Apache Kafka for over 7 years. I inevitably find myself doing the same set of activities while I'm developing or working with someone else's system. Here's a set of Kafka productivity hacks for doing a few things way faster than you're probably doing them now. 🔥
import java.lang.reflect.Field; | |
import sun.misc.Unsafe; | |
public class TestThreadStackSize { | |
private static void crashVM() { | |
try { | |
makeSegfault(getUnsafe()); | |
} catch (Exception e) { | |
// swallow | |
} |