Skip to content

Instantly share code, notes, and snippets.

View zakame's full-sized avatar

Zak B. Elep zakame

View GitHub Profile
@deefdragon
deefdragon / migrate.configmap.yaml
Last active May 5, 2024 09:33
Migrating Kubernetes PVC/PVs from one storage class to another
apiVersion: v1
kind: ConfigMap
metadata:
# any name can be used; Velero uses the labels (below)
# to identify it rather than the name
name: change-storage-class-config
# must be in the velero namespace
namespace: velero
# the below labels should be used verbatim in your
# ConfigMap.
@ctrlcctrlv
ctrlcctrlv / rust-maintainer-perfectionism.md
Last active January 4, 2024 15:42
Rust maintainer perfectionism

Rust maintainer perfectionism, or, the tragedy of Alacritty

I did not submit this to Hacker News and did not intend that this post would have high circulation but have no real problem with it being there or with it having such. I have more recent comments below. This post is from January 2020 and predates the Modular Font Editor K (MFEK) project.

I have not worked on Rust projects in quite a while, and don't know if I ever will again. I feel many crate maintainers are way too perfectionist, for example, despite all the developer hours that went into this PR, it took the effort within years to be (halfway) merged.

There's always a reason not to merge, isn't there? It would be better done with a new nightly language feature, or the function signature should have a where clause, or the documentation is not perfect. There's always a new nit to pick in the world of Ru

@Ovid
Ovid / cor.md
Last active September 12, 2021 08:02
Cor—A minimal object system for the Perl core

NAME

Cor — A minimal OO proposal for the Perl core

VERSION

This is version 0.10 of this document.

AUTHOR

@jackrusher
jackrusher / gcloud-tramp.el
Created June 19, 2019 13:58
Tramping into GCloud instances from within emacs
;; make sure you've set your default project with:
;; gcloud config set project <project-name>
(require 'tramp)
(add-to-list 'tramp-methods
'("gcssh"
(tramp-login-program "gcloud compute ssh")
(tramp-login-args (("%h")))
(tramp-async-args (("-q")))
(tramp-remote-shell "/bin/sh")
@krisleech
krisleech / renew-gpgkey.md
Last active May 12, 2024 16:55
Renew Expired GPG key

Renew GPG key

Given that your key has expired.

$ gpg --list-keys
$ gpg --edit-key KEYID

Use the expire command to set a new expire date:

@mbbx6spp
mbbx6spp / .00readme.org
Last active August 22, 2023 02:42
A caching and persistent Nix shell with direnv

Cached and Persistent Nix shell with direnv integration

Problem being solved

  • the default direnv Nix integration from projects loads a Nix shell every new terminal or every time shell.nix and/or default.nix changes. On larger projects with a lot of Nix shell dependencies, that can cause the terminal to take more than 6 seconds to load, which significantly degrades the developer experience (DX).
  • when a developer garbage collects in their Nix store, often the Nix shell dependencies are deleted also which causes a slow start the next time the project’s Nix shell is requested, also degrading developer experience (DX).

Solution outline

  • on first Nix shell load, the Nix shell is evaluated fully such that direnv dumps the environment from the spawn Nix shell process
@peti
peti / README.md
Last active January 29, 2024 00:21
Make NixOS provide version-specific LOCALE_ARCHIVE environment variables

This NixOS code ensures that the system provide version-specific $LOCALE_ARCHIVE environment variables to mitigate the effects of NixOS/nixpkgs#38991.

To deploy it, copy the file into your /etc/nixos folder using a file name like multi-glibc-locale-paths.nix. Then edit your configuration.nix file to contain the attribute:

imports = [ ./multi-glibc-locale-paths.nix ];
@madumlao
madumlao / pi.py
Created April 21, 2018 02:25
Calculates and prints pi
from __future__ import print_function
def picount(n):
count = 2.0
i = 0
j = 1
for k in range(0,n):
if k % 2 == 0:
i += 2
else:
@aprilmintacpineda
aprilmintacpineda / fun-with-bubble-sort.md
Last active September 7, 2021 07:30
Bubble sort implementations in JS, PHP, PY, and Java with tests and performance measurement.

Fun with JS, PHP, PY, and Java

Lots of developers argue about which programming language should be used to do this and that, in reality, all their answers are hugely affected by self bias, most of the time, programmers would use something in favor of something else because of comfortability, they are simply more comfortable using whatever they chose.

All high-level programming languages are pretty much alike, they were built on top of the same concepts, there's MVC in PHP, Java, JavaScript, Python, .NET, etc., they may differ in syntax, but at their very core, they are alike. Much like humans, we differ in color, height, body size, etc., but at our very core, we're all alike, but they differ in terms of speed, like humans differ in intelligence.

So, I made a bubble sort implementation in Java, JavaScript, PHP, and Python. If you don't know the bubble sort algorithm yet and you want to know, then read the [pseudocode](https://gist.github.com/aprilmintacpineda/7800a989f1f494ee8d

@ekaschalk
ekaschalk / esh-custom.el
Created June 24, 2017 04:39
Customizing your emacs shell.
(require 'dash)
(require 's)
(defmacro with-face (STR &rest PROPS)
"Return STR propertized with PROPS."
`(propertize ,STR 'face (list ,@PROPS)))
(defmacro esh-section (NAME ICON FORM &rest PROPS)
"Build eshell section NAME with ICON prepended to evaled FORM with PROPS."
`(setq ,NAME