Skip to content

Instantly share code, notes, and snippets.

View taktoa's full-sized avatar
🤔
Confused about why this feature exists

Remy Goldschmidt taktoa

🤔
Confused about why this feature exists
View GitHub Profile
@taktoa
taktoa / bootstrap.nix
Last active November 8, 2017 22:52
Portably bootstrap nixpkgs without fetchTarball nonsense
{ system ? builtins.currentSystem }:
# In order to update `nixpkgs.json` to a specific revision, run:
#
# ```bash
# $ nix-prefetch-git https://github.com/NixOS/nixpkgs.git "${REVISION}" > nixpkgs.json
# ```
with rec {
builtin-paths = import <nix/config.nix>;
@taktoa
taktoa / incremental.nix
Last active January 8, 2018 12:57
Build the profunctors library incrementally using Nix.
with builtins;
rec {
pkgs = import <nixpkgs> {};
testGHC = pkgs.haskellPackages.ghcWithPackages (p: with p; [
base base-orphans bifunctors comonad contravariant distributive
tagged transformers
]);
@taktoa
taktoa / vim.nix
Last active September 29, 2020 03:51 — forked from cleverca22/vim.nix
# FIXME: replace @NIX_RUSTRACER@ and @NIX_RUSTC@ using `substituteAllInPlace`
# and pkgs.runCommand
{ pkgs }:
pkgs.vim_configurable.customize {
name = "vim";
vimrcConfig = {
customRC = builtins.readFile ./vimrc;
vam.pluginDictionaries = [ {
@taktoa
taktoa / vim.nix
Created April 24, 2017 22:58 — forked from cleverca22/vim.nix
{config,pkgs,...}:
let
myVim = pkgs.vim_configurable.customize {
name = "vim";
vimrcConfig = {
customRC = ''
syntax on
set nu
set foldmethod=syntax
@taktoa
taktoa / Closure.hs
Last active April 19, 2017 20:09
A Haskell script that computes the transitive RPATH closure of a Nix store path.
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Prelude hiding (FilePath)
import Control.Foldl (list)
import Control.Arrow
@taktoa
taktoa / survive-java.md
Last active February 14, 2017 00:27
Haskellish tools for Java

Tools For Java That Make It More Like Haskell

  • [Checker Framework][checker]
    • FIXME: description
  • [Derive4J][derive4j]
    • FIXME: description
  • [hkt][hkt]
    • FIXME: description
  • [junit-quickcheck][junit-qc]
  • FIXME: description
@taktoa
taktoa / normalize-since-qtbase.diff
Created January 2, 2017 09:33
Normalize all uses of \since in qtbase
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 48dbadb..fa7b719 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -133,7 +133,7 @@ Q_STATIC_ASSERT_X(QT_POINTER_SIZE == sizeof(void *), "QT_POINTER_SIZE defined in
/*!
\fn QFlag::QFlag(uint value)
- \since Qt 5.3
+ \since 5.3
@taktoa
taktoa / example-qdocindex-usage.bash
Last active January 3, 2017 12:32
Generate QDocIndex XML from a C++ project with the generateXML function defined in `generate-xml.bash`. Run `example-qdocindex-usage.bash` to see the output for qtbase with the given `index.qdocconf` (which currently needs to be modified for other C++ projects).
#!/usr/bin/env bash
# Download this gist to get index.qdocconf and generate-xml.bash
git clone https://gist.github.com/taktoa/2ee1253020d81341f7d4377771c418b7 gist
source ./gist/generate-xml.bash
move ./gist/index.qdocconf .
rmDir ./gist
# Make a folder called "qtbase" containing a source checkout of qtbase
export QT_VERSION="5.6.1-1"
@taktoa
taktoa / clang_cpp_ast_viewer.py
Created December 30, 2016 08:41
Minimal Clang code using Python binding to traverse a C++ AST
#!/usr/bin/env python
""" Usage: call with <filename>
"""
#
# Understanding CLang AST : http://clang.llvm.org/docs/IntroductionToTheClangAST.html
#
# Requirements
#
# 1. Install Clang : Visit http://llvm.org/releases/download.html
#
@taktoa
taktoa / seL4.nix
Last active November 9, 2017 07:17
seL4 Nix expression for Raspberry Pi 3 (may be broken!)
with rec {
pkgs = import <nixpkgs> {};
inherit (pkgs) stdenv gcc-arm-embedded libxml2 ncurses python27Packages;
inherit (pkgs) which fetchFromGitHub;
};
stdenv.mkDerivation rec {
name = "seL4";
src = fetchFromGitHub {