Skip to content

Instantly share code, notes, and snippets.

View rehno-lindeque's full-sized avatar

Rehno Lindeque rehno-lindeque

View GitHub Profile
@rehno-lindeque
rehno-lindeque / elm-tuple-proposal.md
Last active May 25, 2016 19:14
Elm tuple proposal

Overview

Lately I've been annoyed that Haskell has tuples with more than 2 elements. It seems to me like a great deal of boilerplate in Haskell comes from writing code like Data.Profunctor.Product. One can find many, many more examples like this in Haskell libraries.

That is to say, suppose you could define types like this:

type alias A = (x,(x,x))
@rehno-lindeque
rehno-lindeque / NixSetup.md
Last active September 13, 2024 01:22
NixOS Setup (Virtualized + Haskell + Gnome3 + XMonad)

Setup NixOS (Virtualized + Haskell + Gnome3 + XMonad)

Before you get started

This is pretty out of date now... you may want to look elsewhere

Newer guides than mine (mine is a bit dated and has a lot of rough edges):

Have you looked at these?

@rehno-lindeque
rehno-lindeque / StandardForm.elm
Last active September 8, 2015 21:16
Submit form in Elm
module Bootstrap.StandardForm where
import Signal exposing (Address)
import Html exposing (Html, text)
import Html.Shorthand exposing (..)
import Bootstrap.Html exposing (..)
import List
import Maybe
saveButton : BtnParam
@rehno-lindeque
rehno-lindeque / elm-controls-wishlist.md
Last active January 12, 2016 03:44
Wishlist for Elm form controls

(TLDR; This is a super naive list, just a few quick thoughts)

I was thinking that perhaps having some kind of % coverage for things that people will need in practice in order to use Elm for rapidly creating nice GUIs. However, I also think there needs to be some kind of (mental, at a minimum) framework for people to work inside so that new controls are easily extensible, styling agnostic, work uniformly with other form controls + validation etc before it can really become mainstream. I'll start adding some thoughts here over time (not much time now) - however, this doesn't cover the second point and I think people still need to get into that before things can really progress very far.

Form handling

Inputs fields

  • display masking (e.g. static slashes and colons for __/__/__, __:__:__ formatting)
  • simple inline dropdowns (e.g. dropdown/typeahead for `10 [days/months/year
@rehno-lindeque
rehno-lindeque / gist:36e1e5720ca05f89e985fc7b62f54158
Created April 9, 2016 10:56 — forked from yorickvP/gist:3171926
generic C/C++ project makefile template
ifdef VERBOSE
Q =
E = @true
else
Q = @
E = @echo
endif
CFILES := $(shell find src -mindepth 1 -maxdepth 4 -name "*.c")
CXXFILES := $(shell find src -mindepth 1 -maxdepth 4 -name "*.cpp")
@rehno-lindeque
rehno-lindeque / reload-browser
Last active January 3, 2025 10:46
Reload browser from the command-line (modified from entr project)
#!/bin/sh
# reload-browser - A cross-platform wrapper for reloading the current
# browser tab
# Eric Radman, 2014
# http://entrproject.org/
# The original script is at http://entrproject.org/scripts/reload-browser
usage() {
case `uname` in
@rehno-lindeque
rehno-lindeque / keybase.md
Created February 13, 2017 08:47
Keybase proof

Keybase proof

I hereby claim:

  • I am rehno-lindeque on github.
  • I am rehno (https://keybase.io/rehno) on keybase.
  • I have a public key ASC43w0YSIlWS1zqbAVodwZF-SohWmPkl9-iws4w2Nx43go

To claim this, I am signing this object:

@rehno-lindeque
rehno-lindeque / deferred-build-experiment.nix
Last active June 3, 2018 13:15
Experimenting with deferred builds in nix
let
makeDeferredBuildService = package:
let
drvPath = builtins.unsafeDiscardOutputDependency package.drvPath;
outPath = builtins.unsafeDiscardStringContext package.outPath;
drvName = package.name;
gcrootDir = "/nix/var/nix/gcroots/deferred-builds";
deferredBuildScript =
with pkgs;
@rehno-lindeque
rehno-lindeque / mask-freet.hs
Last active June 23, 2018 23:08
FreeT MonadMask experimentation
#! /usr/bin/env nix-shell
#! nix-shell -i runghc -p "haskellPackages.ghcWithPackages (pkgs: with pkgs; [ text free exceptions_0_10_0 ])"
#! nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs-channels/archive/nixpkgs-unstable.tar.gz
-- #! nix-shell -i runghc -p haskellPackages.text haskellPackages.free "haskellPackages.callHackage ''exceptions'' ''0.10.0'' {}"
{-# language DeriveFunctor, FlexibleInstances #-}
-- | Historical background reading for this experiment (in historical order):
--
-- * https://stackoverflow.com/questions/41966893/why-is-there-no-monadmask-instance-for-exceptt
@rehno-lindeque
rehno-lindeque / xmodmap.norman
Last active September 30, 2018 04:02
Personalised xmodmap for Norman keyboard layout
! My personalized version of the xmodmap for the Norman layout.
! http://normanlayout.info
! Originally from https://github.com/deekayen/norman
keycode 49 = grave asciitilde dead_tilde asciitilde
keycode 10 = 1 exclam exclamdown onesuperior
keycode 11 = 2 at masculine twosuperior
keycode 12 = 3 numbersign ordfeminine threesuperior
keycode 13 = 4 dollar cent sterling
keycode 14 = 5 percent EuroSign yen