Skip to content

Instantly share code, notes, and snippets.

View ahndmal's full-sized avatar
😔
stand with my homeland Ukraine

Andrii Maliuta ahndmal

😔
stand with my homeland Ukraine
View GitHub Profile
syntax = "proto3";
package tutorial;
message Person {
optional string name = 1;
optional int32 id = 2;
optional string email = 3;
enum PhoneType {
package main
import (
"fmt"
"sync"
"time"
)
func worker(id int) {
fmt.Printf("Worker %d starting\n", id)
@Configuration
public class OAuth2LoginConfig {
@Bean
public ReactiveClientRegistrationRepository clientRegistrationRepository() {
return new InMemoryReactiveClientRegistrationRepository(this.googleClientRegistration());
}
private ClientRegistration googleClientRegistration() {
return ClientRegistration.withRegistrationId("google")
// 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";
@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();
@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
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);
}
# 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
public static LocalDate toLocalDate(Date date) {
return date == null ? null : date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
}
package main
import (
"fmt"
"github.com/gempir/go-twitch-irc"
)
func main() {
client := twitch.NewClient("BOT", fmt.Sprintf("oauth: %s", oauthToken))