Skip to content

Instantly share code, notes, and snippets.

View exu's full-sized avatar
🇵🇱

Jacek Wysocki exu

🇵🇱
View GitHub Profile
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"ollama-lan": {
"npm": "@ai-sdk/openai-compatible",
"name": "Ollama LAN",
"options": {
"baseURL": "http://192.168.50.236:11434/v1"
},
"models": {
@exu
exu / kubernetes-websocket.go
Created September 16, 2022 11:26 — forked from jezell/kubernetes-websocket.go
Connect to Kubernetes endpoint over websockets
package main
import (
"bytes"
"flag"
"golang.org/x/net/websocket"
"io"
"k8s.io/client-go/1.4/rest"
"k8s.io/client-go/1.4/tools/clientcmd"
"log"
@exu
exu / fssse.go
Created November 9, 2021 15:09 — forked from dudochkin-victor/fssse.go
fasthttp sse
package main
import (
"bufio"
"fmt"
"log"
"time"
"github.com/valyala/fasthttp"
)
@exu
exu / keybase.md
Created September 16, 2021 07:09

Keybase proof

I hereby claim:

  • I am exu on github.
  • I am ex00 (https://keybase.io/ex00) on keybase.
  • I have a public key ASA64vm8QItIOkLbBvBbpHqRQpNnxmEISrW2qI2QVFw2EQo

To claim this, I am signing this object:

@exu
exu / keybase.md
Created September 15, 2021 05:38

Keybase proof

I hereby claim:

  • I am exu on github.
  • I am ex00 (https://keybase.io/ex00) on keybase.
  • I have a public key ASDPy0ZW9L2wtGYzcic-fjJZNr0sXSLKeaiu5mXV8tlhsgo

To claim this, I am signing this object:

@exu
exu / 00_destructuring.md
Created October 15, 2020 17:32 — forked from john2x/00_destructuring.md
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@exu
exu / sse.go
Created June 15, 2020 07:56 — forked from schmohlio/sse.go
Example SSE server in Golang
// v2 of the great example of SSE in go by @ismasan.
// includes fixes:
// * infinite loop ending in panic
// * closing a client twice
// * potentially blocked listen() from closing a connection during multiplex step.
package main
import (
"fmt"
"log"
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
@exu
exu / RestConfiguration.java
Created September 3, 2019 06:37 — forked from ripla/RestConfiguration.java
The different ways of accessing a REST HATEOAS resource created with Spring Data. Using a Spring RestTemplate.
import java.util.Arrays;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.hateoas.MediaTypes;
import org.springframework.hateoas.hal.Jackson2HalModule;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.web.client.RestTemplate;