Skip to content

Instantly share code, notes, and snippets.

@sternenseemann
sternenseemann / codimd-dependencies.nix
Last active May 21, 2021 08:27 — forked from Profpatsch/hackmd-dependencies.nix
Example of a minified nix output of yarn2nix for the CodiMD/server project yarn.lock
{ fetchurl, fetchgit }:
self:
super:
let
registries = {
yarn = n:
v:
"https://registry.yarnpkg.com/${n}/-/${n}-${v}.tgz";
npm = n:
v:
diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix
index 80fdb8a95e6..4a52ba40e39 100644
--- a/pkgs/development/haskell-modules/configuration-common.nix
+++ b/pkgs/development/haskell-modules/configuration-common.nix
@@ -394,6 +394,22 @@ self: super: {
Random123 = dontCheck super.Random123;
systemd = dontCheck super.systemd;
+ # use the correct version of network
+ systemd_2_2_0 = dontCheck (super.systemd_2_2_0.override {
@sternenseemann
sternenseemann / philcite.sty
Last active October 6, 2019 15:19
LaTeX Bibliografiestil für Philosophie
\ProvidesPackage{philcite}
\usepackage{csquotes}
\usepackage[%
style=philosophy-verbose%
, sorting=nyt%
, shorthandintro=true%
, loccittracker=context%
, inbeforejournal=true
]{biblatex}
[Definition]
failregex = pam_unix\(rpam:auth\): authentication failure; logname=.* uid=\d* euid=\d* tty=.* ruser=.* rhost=<HOST>\s*user=.*$
@sternenseemann
sternenseemann / warpspeed.hs
Created March 12, 2017 14:26 — forked from Profpatsch/warpspeed.hs
Like python’s SimpleHTTPServer.
#!/usr/bin/env nix-shell
#!nix-shell -i runhaskell -p "haskellPackages.ghcWithPackages (hps: with hps; [wai-middleware-static warp unix])"
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Network.Wai
import Network.Wai.Middleware.Static
import Network.Wai.Handler.Warp
import Network.HTTP.Types.Status
import System.Posix.Directory
@sternenseemann
sternenseemann / tokenize.c
Last active November 24, 2016 23:16
Appearantly a lisp tokenizer
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <ctype.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#define TOKENS_CHUNK 50
#!/bin/sh
nix-shell -p pkgs.opam pkgs.ocamlPackages_4_03.ocaml pkgs.aspcud pkgs.m4 pkgs.gnumake pkgs.binutils pkgs.gcc pkgs.gmp \
--command ". $HOME/.opam/opam-init/init.sh; eval \`opam config env\`; return" \
-I nixpkgs=$HOME/src/nix/nixpkgs
(ql:quickload "chirp")
(ql:quickload "trivial-http")
(defparameter chirp:*oauth-api-key*
"toplel")
(defparameter chirp:*oauth-api-secret*
"lolnope")
(defparameter chirp:*oauth-access-token*
"roflmao")
(defparameter chirp:*oauth-access-secret*
@sternenseemann
sternenseemann / infinite.hs
Created December 6, 2015 14:02
Infinite Lists
module Data.Infinite where
import Prelude hiding (iterate, take, drop)
data Infinite a = Cons a (Infinite a) deriving Show
simple :: a -> Infinite a
simple x = Cons x $ simple x
iterate :: a -> (a -> a) -> Infinite a
@sternenseemann
sternenseemann / blink.c
Last active August 29, 2015 14:05
avr blink program