Skip to content

Instantly share code, notes, and snippets.

View steshaw's full-sized avatar
👨‍💻
Loves programming languages

Steven Shaw steshaw

👨‍💻
Loves programming languages
View GitHub Profile
@adambom
adambom / README.md
Last active May 27, 2024 07:51
Backup Kubernetes Cluster State

Run this in order to backup all you k8s cluster data. It will be saved in a folder bkp. To restore the cluster, you can run kubectl apply -f bkp.

Please note: this recovers all resources correctly, including dynamically generated PV's. However, it will not recover ELB endpoints. You will need to update any DNS entries manually, and manually remove the old ELB's.

Please note: This has not been tested with all resource types. Supported resource types include:

  • services
  • replicationcontrollers
  • secrets
  • deployments
  • horizontal pod autoscalers
@saurabhnanda
saurabhnanda / extending-opaleye.md
Last active November 26, 2017 09:43
Extending Opaleye

Context

As a user of Opaleye, I feel that Opalaye's public API is missing a number of features/niceties that are required by most people using the library in a largish project. The number of separate projects trying to close these gaps seem to strengthen this point:

Based on the discussion at silkapp/girella#9, specifically Tom's approval in that thread, this is an effort to build consensus around features that Opaleye's users would like to see in the core library directly. Of course, these features should not compromise general principles that @tomjaguarpaw has specifically mentioned:

Applied Functional Programming with Scala - Notes

Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
@Profpatsch
Profpatsch / hasklig.el
Created August 31, 2016 16:23
Getting Hasklig to work in Emacs
;; nice glyphs for haskell with hasklig
;; copied that code from some pastebin, but forgot where
(custom-set-variables '(haskell-font-lock-symbols t)
'(haskell-font-lock-symbols-alist
(and (fboundp 'decode-char)
(list (cons "&&" (decode-char 'ucs #XE100))
(cons "***" (decode-char 'ucs #XE101))
(cons "*>" (decode-char 'ucs #XE102))
(cons "\\\\" (decode-char 'ucs #XE103))
(cons "||" (decode-char 'ucs #XE104))
@snoyberg
snoyberg / upper-bounds.md
Created May 27, 2016 03:13
Michael Snoyman's personal take on PVP version upper bounds

In response to a request on Reddit, I'm writing up my thoughts on PVP upper bounds. I'm putting this in a Gist since I don't want to start yet another debate on the matter, just provide some information to someone who asked for it. Please don't turn this into a flame war :)

For those unaware: the Package Versioning Policy is a set of recommendations covering how to give version numbers to your packages, and how to set upper and lower bounds on your dependencies.

I'll start by saying: I support completely with the PVP's recommendations on how to assign version numbers. While there are plenty of points in this design space, the PVP is an unobjectionable one, and consistency in the community is good. On multiple occasions, I have reached out to package authors to encourage compliance with this. (However, I've always done so privately, as opposed to a statement on Reddit, as I believe that to be a more likely route to successful convincing.)

The issue aro

@martijnvermaat
martijnvermaat / nixos.md
Last active February 16, 2025 00:09
Installation of NixOS with encrypted root
@aaronlevin
aaronlevin / config.nix
Created April 21, 2016 10:49
Use Nix to build vim with +python support + custom python libraries
# I wanted to use ensime with vim, which requires vim + python + some python packages (websocket_client + sexpdata)
# unfortunately, nix would build vim with a python that didn't have access to my system libraries (for referential transperancy)
# so I needed to provide to `vim_configurable.nix` the right python to use *and* enable python, lua, etc. support.
# I also wanted to keep my `.vimrc` separate because some of the vim packages I use weren't available.
#
# install via: `nix-env -f '<nixpkgs>' -iA myCoolVim` or `nix-env -I nixpkgs=/path/to/your/nixpkgs -f '<nixpkgs>' -iA myCoolVim`
#
# out put of `vim --version` below.
{
# see https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/
# core
brew install coreutils
# key commands
brew install binutils
brew install diffutils
brew install ed --default-names
brew install findutils --with-default-names
@eddieh
eddieh / libevent-v-libuv.md
Last active April 11, 2025 12:39
libevent vs libuv

libevent vs libuv

Comparing libevent and libuv. My upfront biased: I want to like libevent. However, I want to objectively compare the two and make an informed decision.

What versions are we comparing?

  • libevent 2.0.22 (Stable) [2014-01-05]
  • libuv 1.8.0 (Stable) [2015-12-15]
@edolstra
edolstra / nix-ui.md
Last active July 14, 2024 21:22
Nix UI

General notes

  • nix-channel and ~/.nix-defexpr are gone. We'll use $NIX_PATH (or user environment specific overrides configured via nix set-path) to look up packages. Since $NIX_PATH supports URLs nowadays, this removes the need for channels: you can just set $NIX_PATH to e.g. https://nixos.org/channels/nixos-15.09/nixexprs.tar.xz and stay up to date automatically.

  • By default, packages are selected by attribute name, rather than the name attribute. Thus nix install hello is basically equivalent to nix-env -iA hello. The attribute name is recorded in the user environment manifest and used in upgrades. Thus (at least by default) hello won't be upgraded to helloVariant.

    @vcunat suggested making this an arbitrary Nix expression rather than an attrpath, e.g. firefox.override { enableFoo = true; }. However, such an expression would not have a key in the user environment, unlike an attrpath. Better to require an explicit flag for this.

TBD: How to deal with search path clashes.