Skip to content

Instantly share code, notes, and snippets.

;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
(ns clara.compatibility
(:require [clara.rules.accumulators :as acc]
[clara.tools.tracing :as tracing]
[clara.tools.inspect]
[clara.rules :refer :all]))
(defrecord Compatible [items])
(defrecord Incompatible [items])
(defrecord Protein [])
;; (server-start)
emacsclient --eval '(with-current-buffer "*scratch*" (insert "do you see me?"))'

The simplest implementation might look like this:

class ArrayUtils def self.multiplos(num, step) step.step(num * step, step).to_a end end

The simplest implementation might look like this:
<!-- language: lang-ruby -->
class ArrayUtils
def self.multiplos(num, step)
step.step(num * step, step).to_a
end
end
// custom error handling logic
const retryThreeTimes = obs =>
obs.retry(3).catch(_ => Rx.Observable.of('ERROR!'));
const examplePromise = val =>
new Promise(resolve => resolve(`Complete: ${val}`));
//faking request
const subscribe = Rx.Observable.of('some_url')
.mergeMap(url => examplePromise(url))
// could reuse error handling logic in multiple places with let
@nfedyashev
nfedyashev / presentation.org
Created February 15, 2021 22:29 — 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
@nfedyashev
nfedyashev / config
Created July 22, 2021 13:09
i3blocks - clickable command counter
[click-loop-json]
full_text=Click me!
command=ruby -r json -n -e '$_ = JSON.parse($_)' -e '$_["full_text"] = "Click %s at (%d,%d)" % $_.slice("button", "x", "y").values' -e 'puts JSON.dump($_)' -e 'STDOUT.flush'
interval=persist
format=json
@nfedyashev
nfedyashev / config
Created July 22, 2021 13:12
i3blocks - ruby json output command
# [ib]
# command=/home/nikita/.rbenv/shims/ruby /home/nikita/Projects/nikita-dotfiles/bin/ibb
# interval=10
# format=json
# frozen_string_literal: true
require "bundler/setup"
require_relative "../lib/ibb
require 'json'
@nfedyashev
nfedyashev / expech.sh
Created March 9, 2023 19:37
Using expect to drive netcat - Simply piping the required sequence of commands into netcat is unlikely to work because the SMTP commands and responses would not be properly interleaved. If you want to use the method above from a script then you will need to make use of a program such as expect. Here is an example:
#!/usr/bin/expect
set timeout 30
proc abort {} { exit 2 }
spawn nc -C mail.example.org 25
expect default abort "220 "
send "HELO example.com\r"
expect default abort "\n250 "
send "MAIL FROM:bar@example.org\r"