Skip to content

Instantly share code, notes, and snippets.

Avatar

Pavel Kulyov pkulev

View GitHub Profile
@abrochard
abrochard / presentation.org
Last active Apr 12, 2022
Notes from the "Conquering Kubernetes with Emacs" presentation
View presentation.org

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
@alex-eg
alex-eg / platform-var.el
Created May 7, 2018
elisp platform-set-variable
View platform-var.el
(defvar *var-plist* (list))
(defmacro platform-var (name &rest plist)
(let ((plist-keys (mapcar 'car (seq-partition plist 2)))
(platforms '(:gnu :gnu/linux :gnu/kfreebsd :darwin :ms-dos :windows-nt :cygwin)))
(mapcar (lambda (key)
(when (not (member key platforms))
(error "Platform `%s' doesn't exist. Possible values: `%s'" key platforms)))
plist-keys)
(setq *var-plist* (plist-put *var-plist* name plist))
@Wilfred
Wilfred / regex.org
Last active Jan 7, 2020
Native Rust Regular Expressions in Remacs
View regex.org

RFC: Use Rust’s regex crate

We want to port Remacs to use a regex crate implemented in Rust. The Rust implementations are highly optimised, and this would simplify the Remacs codebase.

The two major crates are Rust’s regex crate, and the fancy-regex crate.

View get_jdk.sh
#!/bin/bash
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <version> <revision>"
echo "for example for Java 1.8.0.92 it would be:"
echo "$0 8 92"
exit 1
fi
VERSION="$1u$2"
@SpotlightKid
SpotlightKid / ecs_example.py
Last active Nov 19, 2015
Example of plumbing needed to use the ecs package
View ecs_example.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
from ecs import Component, Entity, EntityManager, System, SystemManager
class MovementSystem(System):
"""Movement system to update position of Movable components."""
@staltz
staltz / introrx.md
Last active May 20, 2022
The introduction to Reactive Programming you've been missing
View introrx.md
@chaitanyagupta
chaitanyagupta / _reader-macros.md
Last active May 17, 2022
Reader Macros in Common Lisp
View _reader-macros.md

Reader Macros in Common Lisp

This post also appears on lisper.in.

Reader macros are perhaps not as famous as ordinary macros. While macros are a great way to create your own DSL, reader macros provide even greater flexibility by allowing you to create entirely new syntax on top of Lisp.

Paul Graham explains them very well in [On Lisp][] (Chapter 17, Read-Macros):

The three big moments in a Lisp expression's life are read-time, compile-time, and runtime. Functions are in control at runtime. Macros give us a chance to perform transformations on programs at compile-time. ...read-macros... do their work at read-time.

View robot_simple.py
#! /usr/bin/python
import curses
from curses import KEY_RIGHT, KEY_LEFT, KEY_UP, KEY_DOWN
import random
from random import randrange, randint
def printRobot(win, pos_x, pos_y, size):
''' Prints the Robot '''
for i in range(size):
@bradwright
bradwright / path.el
Created Mar 15, 2012
Set Emacs exec-path by shell $PATH
View path.el
;; This sets the Emacs "PATH" environment variable and the `exec-path`
;; variable to the same value your login shell sees. The reason this
;; is necessary is because of this:
;;
;; http://developer.apple.com/library/mac/#qa/qa1067/_index.html
;;
;; Basically apps launched from Finder inherit their environment from
;; a .plist file rather than the shell environment.
(defun set-exec-path-from-shell-PATH ()