Skip to content

Instantly share code, notes, and snippets.

;;; unison-ts-mode.el --- Major mode for Unison with tree-sitter support -*- lexical-binding: t; -*-
(require 'treesit)
(require 'rx)
(declare-function treesit-parser-create "treesit.c")
(declare-function treesit-node-type "treesit.c")
(declare-function treesit-node-text "treesit.c")
(declare-function treesit-node-child-by-field-name "treesit.c")
(declare-function treesit-parent-while "treesit.c")
@zetashift
zetashift / highlights.scm
Created July 14, 2023 12:48
Unison WIP highlights
;; Primitives
(comment) @comment
(nat) @constant.numeric
(unit) @constant.builtin
(literal_char) @constant.character
(literal_text) @string
(literal_boolean) @constant.builtin.boolean
;; Keywords
[
@zetashift
zetashift / SvelteKitTypeScriptProject.ts
Last active April 27, 2023 19:54
A SvelteKit projen based off of NextJS (WIP)
/* eslint-disable import/no-extraneous-dependencies */
import {
NodeProjectOptions,
TypeScriptModuleResolution,
} from "projen/lib/javascript";
import {
TypeScriptAppProject,
TypeScriptProjectOptions,
} from "projen/lib/typescript";
import { deepMerge } from "projen/lib/util";
@zetashift
zetashift / example.md
Created March 11, 2023 20:43
Websocket Scala

Using Websockets

def sendInput(input: html.Input, socket: WebSocket) = {
  input.onkeyup = (e: Event) => socket.send(input.value)
}

def echoWebSocket(input: html.Input, pre: html.Pre) = {
  val echo = "ws://echo.websocket.events"
@zetashift
zetashift / todo.scala
Last active October 29, 2022 15:20
wooo
//> using scala "3.2"
//> using lib "org.http4s::http4s-dsl:1.0.0-M29"
//> using lib "org.http4s::http4s-ember-server:1.0.0-M29"
//> using lib "org.http4s::http4s-ember-client:1.0.0-M29"
//> using lib "org.http4s::http4s-circe:1.0.0-M29"
//> using lib "ch.qos.logback:logback-classic:1.2.6"
package zetashift.todo
import cats.effect._
@zetashift
zetashift / qwik-todo.tsx
Created October 27, 2022 22:33
Qwik-todo
import { component$, useStore, $} from '@builder.io/qwik';
export const App = component$(() => {
return <TodoList></TodoList>;
});
interface ITodo {
title: string;
description: string;
@zetashift
zetashift / kanagawa.toml
Created October 15, 2022 15:12
A first stab at a kanagawa based theme
## User interface
"ui.selection" = { bg = "waveBlue1" }
"ui.background" = { fg = "fujiWhite", bg = "sumiInk1" }
"ui.linenr" = { fg = "sumiInk4" }
"ui.statusline" = { fg = "oldWhite", bg = "sumiInk0" }
"ui.statusline.inactive" = { fg = "fujiGray", bg = "sumiInk0" }
"ui.statusline.normal" = { fg = "sumiInk0", bg = "crystalBlue", modifiers = ["bold"] }
"ui.statusline.insert" = { fg = "sumiInk0", bg = "autumnGreen" }
@zetashift
zetashift / HNTest.scala
Last active September 30, 2022 19:12
HackerNews GET with scala-cli and CrossPlatformIOApp
//> using scala "3.1"
//> using lib "org.http4s::http4s-dsl:0.23.12"
//> using lib "org.http4s::http4s-ember-client:0.23.16"
//> using lib "org.http4s::http4s-circe:0.23.16"
//> using lib "io.circe::circe-generic:0.14.3"
//> using lib "io.circe::circe-literal:0.14.3"
//> using lib "io.chrisdavenport::crossplatformioapp:0.1.0"
//> using platform "scala-native"
import io.chrisdavenport.crossplatformioapp.CrossPlatformIOApp
@zetashift
zetashift / Main.scala
Created June 10, 2022 16:09
Http4s and scala-cli
//> using scala "3.1"
//> using lib "org.http4s::http4s-dsl:0.23.12"
//> using lib "org.http4s::http4s-ember-server:0.23.12"
//> using lib "org.http4s::http4s-ember-client:0.23.12"
import cats.effect._
import org.http4s._
import org.http4s.dsl.io._
import org.http4s.ember.server.EmberServerBuilder
import org.http4s.server.Router
// Place your key bindings in this file to override the defaults
[
{
"key": "space",
"command": "dance.openMenu",
"args": {
"input": "leader"
},
"when": "!inputFocus || editorTextFocus && dance.mode == 'normal'"
},