Skip to content

Instantly share code, notes, and snippets.

@simlei
simlei / bind.bash
Created April 26, 2019 20:23
bash code that handles binds
#TODO: these depend on fzf re-bindings to be present; rip them out and have that code here!
# bind '"\ec": "\C-x\C-addi`__fzf_cd__`\C-x\C-e\C-x\C-r\C-m"'
# bind -m vi-command '"\ec": "ddi`__fzf_cd__`\C-x\C-e\C-x\C-r\C-m"'
bindCmdVi() { #{{{
local binding="$1"
shift
local cmd="$*"
local argNormal="$(printf '"%s": "\C-x\C-addi%s\C-x\C-e\C-x\C-r\C-m"' "$binding" "$cmd")"
local argCmd="$(printf '"%s": "ddi%s\C-x\C-e\C-x\C-r\C-m"' "$binding" "$cmd")"
bind "$argNormal"
@edolstra
edolstra / nix-lang.md
Last active May 2, 2024 23:39
Nix language changes

This document contains some ideas for additions to the Nix language.

Motivation

The Nix package manager, Nixpkgs and NixOS currently have several problems:

  • Poor discoverability of package options. Package functions have function arguments like enableFoo, but there is no way for the Nix UI to discover them, let alone to provide programmatic ways to
@dbuenzli
dbuenzli / topkg-blurb.md
Last active April 12, 2017 20:49
topkg-blurb

There is one issue that bazaars, library operating systems like MirageOS or random left-padists face: how to scale extreme software modularization. Scaling not from a software composition perspective; this could be readily solved by using the type system and the functional programming techniques everyone's heard about. But scaling from a purely bureaucratic point of view.

The bureaucracy of making sure main issues are being taken care of. The bureaucracy of making sure changes to the software are being clearly communicated to dependents. The bureaucracy of making sure the software

@aherrmann
aherrmann / pnix-shell.sh
Last active August 23, 2020 20:31
Fully persistent Nix shell
# This is free and unencumbered software released into the public domain.
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
# In jurisdictions that recognize copyright laws, the author or authors
# of this software dedicate any and all copyright interest in the
# software to the public domain. We make this dedication for the benefit
@TikhonJelvis
TikhonJelvis / shell.nix
Last active October 18, 2020 03:24
A simple shell.nix for a Haskell project that calls cabal2nix for you.
{ nixpkgs ? import <nixpkgs> {}, compiler ? "default" }:
let
inherit (nixpkgs) pkgs;
# Build a default.nix file from our .cabal file:
here = ./.;
project = pkgs.stdenv.mkDerivation ({
name = "default.nix";
rec {
test1 = builtins.scopedImport { __nixPath = [ { path = test4; prefix="ssh-config-file"; } ] ++ __nixPath; };
test2 = test1 <nixpkgs/pkgs/build-support/fetchgit/private.nix>;
pkgs = import <nixpkgs> {};
test3 = pkgs.callPackage test2 {};
test4 = pkgs.writeText "sshd_config" ''
# empty file, use programs.ssh.knownHosts in configuration.nix not StrictHostKeyChecking no
'';
test5 = test3 {
url = "git@github.com:cleverca22/not-os.git";
@debasishg
debasishg / gist:8172796
Last active March 15, 2024 15:05
A collection of links for streaming algorithms and data structures

General Background and Overview

  1. Probabilistic Data Structures for Web Analytics and Data Mining : A great overview of the space of probabilistic data structures and how they are used in approximation algorithm implementation.
  2. Models and Issues in Data Stream Systems
  3. Philippe Flajolet’s contribution to streaming algorithms : A presentation by Jérémie Lumbroso that visits some of the hostorical perspectives and how it all began with Flajolet
  4. Approximate Frequency Counts over Data Streams by Gurmeet Singh Manku & Rajeev Motwani : One of the early papers on the subject.
  5. [Methods for Finding Frequent Items in Data Streams](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.187.9800&amp;rep=rep1&amp;t