Skip to content

Instantly share code, notes, and snippets.

@zetashift
zetashift / init.fnl
Last active June 15, 2021 14:33
My Fennel Story
(module magic.init
{autoload {plugin magic.plugin
nvim aniseed.nvim}})
;;; Introduction
;; Aniseed compiles this (and all other Fennel files under fnl) into the lua
;; directory. The init.lua file is configured to load this file when ready.
;; We'll use modules, macros and functions to define our configuration and
@zetashift
zetashift / snap.fnl
Created June 20, 2021 14:52
Snap & fennel
(module magic.plugin.snap
{autoload {snap snap}})
(let [fzf (snap.get :consumer.fzf)
limit (snap.get :consumer.limit)
producer-file (snap.get :producer.ripgrep.file)
producer-jumplist (snap.get :producer.vim.jumplist)
producer-git (snap.get :producer.git.file)
producer-luv-file (snap.get :producer.luv.file)
producer-vimgrep (snap.get :producer.ripgrep.vimgrep)
@zetashift
zetashift / fontim.nim
Last active June 23, 2021 22:04
Fontim, cross platform font path finding in Nim
import os, strformat, options
## Get the locations(paths) of a given `font` in a string
func getFontsDir(): seq[string] =
when defined(windows):
# TODO use winim to get Windows installation location
result = @[r"C:\Windows\Fonts\"]
elif defined(macosx):
result = @[r"/Library/Fonts"]
elif defined(linux):
@zetashift
zetashift / shell.nix
Last active June 24, 2021 21:33
Indigo Shell Nix
{ jdk ? "jdk11" }:
let
pkgs = import <nixpkgs> { inherit jdk; };
in
pkgs.mkShell {
name = "indigo-shell";
buildInputs = [
pkgs.coursier
@zetashift
zetashift / scoptions.scala
Last active August 14, 2021 15:41
Options In Scala
enum Option[+A]:
case Some(value: A)
case None
def map[B](f: A => B): Option[B] = this match
case None => None
case Some(value) => Some(f(value))
def flatMap[B](f: A => Option[B]): Option[B] = this match
case None => None
// 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'"
},
@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
@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 / 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 / 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;