Skip to content

Instantly share code, notes, and snippets.

@myguidingstar
myguidingstar / presentation.org
Created August 26, 2022 00:41 — forked from abrochard/presentation.org
Notes from the "Conquering Kubernetes with Emacs" presentation

Conquering Kubernetes with Emacs

Specific Annoying workflow

Listing pods with kubectl get pods, then select a pod name and copy paste it into kubectl logs [pod name]

Why?

  • I want to streamline my workflow and stop using the terminal
  • learn more about kubernetes
  • main kubernetes extension for Emacs out there is greedy for permissions
(ns helloworld.core)
;; two identical code blocks
;; first one is at top level
(let [{:keys [a-b a_b]} {:a-b 0 :a_b 1}] [a-b a_b])
;; second one nested inside a function call
(println (let [{:keys [a-b a_b]} {:a-b 0 :a_b 1}] [a-b a_b]))
@myguidingstar
myguidingstar / README.md
Last active June 6, 2021 05:45
J language Qt IDE

J language Qt IDE for NixOS

The j package in nixpkgs does not include Qt IDE. This project packages binaries from upstream.

Notes

The IDE (jqt) was written in a way that it must be place in the same directory with jconsole and other *.so files. Therefore this project has them all in a bin directory. (I tried to keep jconsole and jqt in separate packages then combine them back in a FHSUserEnv but it doesn't work).

Though jqt binaries and libraries is included, upstream tarball doesn't contain any *.ijs files, so one must download them using j package manager. You will see complaints that jqt script files are missing when you first start the IDE (jqt).

@myguidingstar
myguidingstar / README.md
Last active July 10, 2021 09:28
Clojurescript REPL for quickjs via weasel

This project code provides a Clojurescript REPL for Quickjs via weasel.

Quickjs is a lightweight javascript engine with low memory footprint. Clojurescript code compiled in advanced mode can be turned into standalone executables via Quickjs's qjsc. Your app can use awesome cljs libraries like core.async, clojure.spec, pathom and datascript without any problem. React should be possible with a custom renderer, like: https://github.com/doodlewind/react-ssd1306

A REPL is handly to develop such apps. The easiest way to create a REPL env for Clojurescript is to leverage weasel. However, Quickjs doesn't support Websocket out of the box. Wiring up a websocket client via C api is undesired. Fortunately, there's a python wrapper for Quickjs.

# This isn't meant to be ran as a script, but line-by-line
# Props to Binary (benary.org) for helping me with this
# 0: Create a Scaleway instance and SSH into it
ssh root@...
# 1: Install Nix
adduser user # set a password, doesn't matter what because it's not staying long
adduser user sudo
su -l user
@myguidingstar
myguidingstar / n2w_ferret.clj
Created March 28, 2020 19:15
Number-> Vietnamese Words, ported to Ferret lang
(def str new-string)
(defmacro u8
[s]
(let [s# (into [] (.getBytes s))]
`(str (list ~@s#))))
(defn digit->words [c]
(cond
(= c \0) (u8 "không"),
@myguidingstar
myguidingstar / core.cljs
Created July 10, 2019 01:19 — forked from yogthos/core.cljs
Gjs ClojureScript example
(ns gjs-example.core)
(defn main []
(set! (-> js/imports .-gi .-versions .-Gtk) "3.0")
(let [Gtk (doto (-> js/imports .-gi .-Gtk) (.init nil))
window (Gtk.Window.
(clj->js
{:type (-> Gtk .-WindowType .-TOPLEVEL)
:title "A default title"
:default_width 300
@myguidingstar
myguidingstar / mtp.nix
Created May 26, 2017 11:39
Nixos stuff
# Meizu MX Phone (MTP): VID=2a45 and PID=2008
services.udev.extraRules= ''
SUBSYSTEM=="usb", ATTR{idVendor}=="2a45", ATTR{idProduct}=="2008", MODE="0666", GROUP="mtp"
'';