Skip to content

Instantly share code, notes, and snippets.

@gilligan
gilligan / Xorg.0.log
Created May 25, 2015 00:26
xorg and nixos configuration files
[ 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
@merijn
merijn / Scraper.hs
Created July 9, 2015 08:20
Concurrent webscraper
{-# LANGUAGE OverloadedStrings #-}
import Control.Concurrent.Async
import Control.Concurrent.QSem
import Control.Monad
import Control.Monad.Catch
import Control.Monad.Trans
import Control.Monad.Reader
import Data.ByteString.Lazy (ByteString)
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}
module Langs where
import Data.Proxy
@novaluke
novaluke / 0-Q&A.md
Last active April 29, 2023 17:23
I want to use Nix for development, but... -- answers to common concerns about Nix

Nix seems perfect for developers - until I try to use it...

Want to use Nix for development but you're not sure how? Concerned about the fluidity of nixpkgs channels or not being able to easily install arbitrary package versions?

When I first heard about Nix it seemed like the perfect tool for a developer. When I tried to actually use it for developing and deploying web apps, though, the pieces just didn't seem to add up.

@kosmikus
kosmikus / TinyServant.hs
Created November 1, 2015 20:30
Implementation of a small Servant-like DSL
{-# LANGUAGE DataKinds, PolyKinds, TypeOperators #-}
{-# LANGUAGE TypeFamilies, FlexibleInstances, ScopedTypeVariables #-}
{-# LANGUAGE InstanceSigs #-}
module TinyServant where
import Control.Applicative
import GHC.TypeLits
import Text.Read
import Data.Time
{-# LANGUAGE DeriveGeneric, FlexibleInstances, ScopedTypeVariables, FlexibleContexts, DataKinds, TypeFamilies #-}
module SwaggerExample where
import Data.Proxy
import qualified GHC.Generics as G
import Generics.SOP
data Todo = Todo {
created :: Int
, description :: String
@fizruk
fizruk / docker-push.sh
Created November 10, 2015 17:12
Push to Docker from Circle CI
#!/bin/sh
set -x
CIRCLE_TAG=`git name-rev --tags --name-only $(git rev-parse HEAD)`
docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
if [ "$CIRCLE_TAG" -ne "undefined" ]; then
docker tag user/repo user/repo:$CIRCLE_TAG
@edsko
edsko / DependentServant.hs
Last active July 2, 2020 06:52
See "Dependently typed servers in Servant" (http://www.well-typed.com/blog/2015/12/dependently-typed-servers/) for the blog post accompanying this gist.
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
flags: {}
packages:
- location: ./.
- location: /home/shahn/src/servant
subdirs:
- servant
- servant-client
extra-dep: true
- location: /home/shahn/src/crdt-tree-vector
@bkaradzic
bkaradzic / orthodoxc++.md
Last active June 7, 2024 01:34
Orthodox C++

Orthodox C++

What is Orthodox C++?

Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.

Why not Modern C++?