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 / 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 / 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 / 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 / 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 / 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 / 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 / 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 / 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 / screen-capture-ubuntu.c
Created July 1, 2014 23:09
Screen capture in ubuntu
// Not mine, politely stolen from http://pastebin.com/cwY9jz7T
// screen-capture-ubuntu.c
// gcc screen-capture-ubuntu.c -o screen-capture-ubuntu `pkg-config --libs --cflags gtk+-2.0`
// http://www.bravegnu.org/gtktext/x498.html
// http://www.cs.dartmouth.edu/~campbell/cs50/project/gtk.html
// http://stackoverflow.com/questions/3124229/taking-a-screenshot-with-c-gtk
// http://stackoverflow.com/questions/11963561/screen-capture-in-haskell?lq=1
// http://askubuntu.com/questions/5847/how-to-resolve-gdk-pixbuf-gdk-pixbuf-h-no-such-file-or-directory
// https://developer.gnome.org/gdk-pixbuf/unstable/gdk-pixbuf-The-GdkPixbuf-Structure.html
@rehno-lindeque
rehno-lindeque / .ghci
Last active August 29, 2015 13:59
Useful REPL utils for Yesod (as well as some generally useful functions!)
:set -i.:config:dist/build/autogen
:set -XCPP -XTemplateHaskell -XQuasiQuotes -XTypeFamilies -XFlexibleContexts -XGADTs -XOverloadedStrings -XMultiParamTypeClasses -XGeneralizedNewtypeDeriving -XEmptyDataDecls -XDeriveDataTypeable
import Prelude
import Control.Applicative
import Data.Char
import Data.List
import qualified Data.Text as T
import Data.Text (Text)