brew install coursier/formulas/coursier && cs setup
This file contains 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
use ropey::{Rope, RopeSlice}; | |
use serde::{Deserialize, Serialize}; | |
use std::fmt; | |
use thiserror::Error; | |
use tower_lsp::lsp_types::{Position, TextDocumentContentChangeEvent}; | |
use tree_sitter::{InputEdit, Parser, Point, Tree}; | |
pub struct TextDocument { | |
pub rope: Rope, | |
pub tree: Option<Tree>, |
This file contains 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
use std::path::Path; | |
use std::process::Stdio; | |
use tokio::io::BufReader; | |
use tokio::io::AsyncBufReadExt; | |
use tokio::process::Command; | |
use tokio::sync::mpsc; | |
/// Execute a process, gather its mixed outputs into stdout | |
/// |
This file contains 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
# Python http.server that sets Access-Control-Allow-Origin header. | |
# https://gist.github.com/razor-x/9542707 | |
import os | |
import sys | |
import http.server | |
import socketserver | |
PORT = 8000 |
This file contains 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
val a = Stream(1) | |
//a: scala.collection.immutable.Stream[Int] = Stream(1, ?) | |
def b: Stream[Int] = Stream(b.head) | |
//b: Stream[Int] | |
a #::: b | |
//res0: scala.collection.immutable.Stream[Int] = Stream(1, ?) | |
a append b |
This file contains 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
val kafkaProps = new Properties() | |
kafkaProps.put("bootstrap.servers", endpoint) | |
kafkaProps.put("key.serializer", classOf[ByteArraySerializer]) | |
kafkaProps.put("key.deserializer", classOf[ByteArrayDeserializer]) | |
kafkaProps.put("value.serializer", classOf[ByteArraySerializer]) | |
kafkaProps.put("value.deserializer", classOf[ByteArrayDeserializer]) | |
kafkaProps.put("group.id", "CrawlerTasksStorage") | |
kafkaProps.put("max.poll.records", "1000") | |
kafkaProps.put("enable.auto.commit","false") |