This file contains hidden or 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
syntax = "proto3"; | |
package tutorial; | |
message Person { | |
optional string name = 1; | |
optional int32 id = 2; | |
optional string email = 3; | |
enum PhoneType { |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"sync" | |
"time" | |
) | |
func worker(id int) { | |
fmt.Printf("Worker %d starting\n", id) |
This file contains hidden or 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
@Configuration | |
public class OAuth2LoginConfig { | |
@Bean | |
public ReactiveClientRegistrationRepository clientRegistrationRepository() { | |
return new InMemoryReactiveClientRegistrationRepository(this.googleClientRegistration()); | |
} | |
private ClientRegistration googleClientRegistration() { | |
return ClientRegistration.withRegistrationId("google") |
This file contains hidden or 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
// Copyright 2018 The Go Authors. All rights reserved. | |
// Use of this source code is governed by a BSD-style | |
// license that can be found in the LICENSE file. | |
"use strict"; | |
(() => { | |
const enosys = () => { | |
const err = new Error("not implemented"); | |
err.code = "ENOSYS"; |
This file contains hidden or 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
@Component | |
public record RClient() { | |
@EventListener(ApplicationReadyEvent.class) | |
public void ready() { | |
var source = RSocketConnector.create() | |
.reconnect(Retry.backoff(50, Duration.ofMillis(500)))// | |
.connect(TcpClientTransport.create("localhost", 7766)); | |
RSocketClient.from(source).fireAndForget(Mono.just(DefaultPayload.create("Reactive Spring!"))).block(); |
This file contains hidden or 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
@Component | |
public record RService() { | |
@EventListener(ApplicationReadyEvent.class) | |
public void ready() { | |
final Logger log = LoggerFactory.getLogger(RService.class); | |
var transport = TcpServerTransport.create(InetSocketAddress.createUnresolved("localhost", 7766)); | |
var socket = new RSocket() { | |
@Override |
This file contains hidden or 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
public abstract class IntervalMessageProducer { | |
public static Flux<String> produce(int c) { | |
return produce().take(c); | |
} | |
public static Flux<String> produce() { | |
return doProduceCountAndStrings().map(CountAndString::message); | |
} |
This file contains hidden or 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 file to your .vim folder and make it read only | |
Hotkeys: | |
SPACE - h - k : Show hotkeys | |
SPACE - g - d : Go to definition | |
SPACE - g - r : Go to reference | |
SPACE - t : Toggle nerdtree | |
SPACE - SPACE - p : Format Prettier | |
SPACE - SPACE - g : Format GoFmt |
This file contains hidden or 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
public static LocalDate toLocalDate(Date date) { | |
return date == null ? null : date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); | |
} |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"github.com/gempir/go-twitch-irc" | |
) | |
func main() { | |
client := twitch.NewClient("BOT", fmt.Sprintf("oauth: %s", oauthToken)) |