Skip to content

Instantly share code, notes, and snippets.

View Foo.hs
{-# LANGUAGE
DeriveGeneric,
FlexibleInstances,
FlexibleContexts,
AllowAmbiguousTypes,
ScopedTypeVariables,
TypeApplications,
TypeFamilies,
TypeOperators,
PartialTypeSignatures,
@dmjio
dmjio / default.nix
Created Apr 12, 2017 — forked from adnelson/default.nix
Nix release builder
View default.nix
# Function which takes a list of packages to install and creates a
# tarball which contains the full list of dependencies of those paths,
# and a script which will install them.
#
# For example, here's how you would create a tarball packaging up
# python3 and nodejs:
#
#
# let
# pkgs = import <nixpkgs> {};
View gist:9e257feae1292c14412c380fd7ac6918
{ pkgs ? import <nixpkgs> {}}:
let
texpkgs = pkgs.texlive.combine {
inherit (pkgs.texlive) scheme-small latexmk;
};
in
pkgs.stdenv.mkDerivation {
name = "mbd";
View gist:db6c1ce67ee84a320aa0971242be3971
{ pkgs ? import <nixpkgs> {}}:
let
texpkgs = pkgs.texlive.combine {
inherit (pkgs.texlive) scheme-small latexmk;
};
in
pkgs.stdenv.mkDerivation {
name = "mbd";
@dmjio
dmjio / 0_reuse_code.js
Created Mar 19, 2017
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View cabal-from-source.nix
{ runCommand, fetchzip, cabal2nix }:
let
package-src = runCommand "package-src" {
src = fetchzip {
url = "...zip";
sha256 = "...";
};
buildInputs = [ cabal2nix ];
}
''
@dmjio
dmjio / Constraints.org
Created Aug 20, 2016 — forked from Icelandjack/Constraints.org
Type Classes and Constraints
View Constraints.org

Type classes are a language of their own, this is an attempt to document some features.

Work in progress.

Accept values with varying number of arguments

Common technique used in EDSLs (embedded domain-specific languages) to accept functions with varying number of arguments.

(Hackage) QuickCheck

quickCheck :: Testable prop => prop -> IO ()
@dmjio
dmjio / Nub.hs
Created Feb 7, 2016 — forked from roelvandijk/Nub.hs
Incredibly slow type-level Nub
View Nub.hs
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}
module Nub where
import Data.Proxy
import Data.Type.Bool
@dmjio
dmjio / configuration.nix
Last active Apr 17, 2017 — forked from DamienCassou/configuration.nix
configuration.nix file for NixOS on my macbook pro
View configuration.nix
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
time.timeZone = "America/Chicago";
@dmjio
dmjio / Xorg.0.log
Created Jan 10, 2016 — forked from gilligan/Xorg.0.log
xorg and nixos configuration files
View Xorg.0.log
[ 165.023]
X.Org X Server 1.16.4
Release Date: 2014-12-20
[ 165.023] X Protocol Version 11, Revision 0
[ 165.023] Build Operating System: Linux 3.12.27 x86_64
[ 165.023] Current Operating System: Linux nixoslappy 3.14.34 #1-NixOS SMP Thu Jan 1 00:00:01 UTC 1970 x86_64
[ 165.023] Kernel command line: initrd=\efi\nixos\pnhjgx3v9pkxyhqhjcxh62l2axwnwd3g-initrd-initrd.efi systemConfig=/nix/store/siybfc2y9prrwk6bab8bz8yh0460axwb-nixos-14.12.496.5f7d374 init=/nix/store/siybfc2y9prrwk6bab8bz8yh0460axwb-nixos-14.12.496.5f7d374/init loglevel=4
[ 165.023] Build Date: 01 March 2015 04:27:12AM
[ 165.023]
[ 165.023] Current version of pixman: 0.32.6