Skip to content

Instantly share code, notes, and snippets.

View KiaraGrouwstra's full-sized avatar
💁‍♀️

kiara KiaraGrouwstra

💁‍♀️
  • Utrecht, the Netherlands
  • 08:00 (UTC +02:00)
View GitHub Profile
let
pkgs = import <nixpkgs> {};
lib = pkgs.lib;
allOptions = (import <nixpkgs/nixos> {}).options;
# ** some helpers
# Like mapAttrs, but if `null` is returned from the mapping function,
# the element is removed from the attrset.
#
@jul1u5
jul1u5 / Gradually Typed Hasktorch.md
Last active September 3, 2021 09:49
Google Summer of Code 2021 Final Report

Report for GSoC 2021 (Gradually Typed Hasktorch)

This is the final report for the GSoC 2021 project - Gradually Typed Hasktorch. Gradually Typed Hasktorch is a new tensor API for Hasktorch. It has been initiated by my mentor, Torsten Scholak, and as part of GSoC I helped with streamlining this new API.

Student: Julius Marozas Mentor: Torsten Scholak

Index

@CMCDragonkai
CMCDragonkai / makeWrapper_and_wrapProgram.md
Created August 24, 2018 07:50
makeWrapper and wrapProgram #nix

makeWrapper and wrapProgram

Nix generally assumes run-time dependencies is a subset of the build-time dependencies.

This means many Nix builder functions try to automatically scan the output for runtime dependencies and "rewrite" them for runtime usage.

However shell scripts which are often exported by packages do not get this automatic scanning treatment.

This means you have to use the makeWrapper package and use either the makeWrapper or wrapProgram utility functions.

@puncoz
puncoz / arch-missing-keyring.md
Last active January 2, 2024 19:59
Arch Linux: missing keyring issue on updates

error: key "CEB167EFB5722BD6" could not be looked up remotely error: required key missing from keyring error: failed to commit transaction (unexpected error)

$ sudo pacman-key --lsign-key CEB167EFB5722BD6

if this gives error ERROR: CEB167EFB5722BD6 could not be locally signed.

$ sudo pacman-key --refresh-keys

@KiaraGrouwstra
KiaraGrouwstra / proxy-async.js
Last active January 3, 2021 15:36
using ES6 Proxy to let Promises/Observables pretend like they're regular values
// using ES6 Proxy to let Promises/Observables pretend like they're regular values.
// get the mapping function used for async objects
let getMapper = (target) => target instanceof Promise ? 'then' :
target instanceof Observable ? 'switchMap' : null;
// ^ fails if the Observable is in a local namespace e.g. Rx.Observable
// bind a value to its object if it's a function
let bindFn = (val, obj) => typeof val == 'function' ? val.bind(obj) : val;