Skip to content

Instantly share code, notes, and snippets.

View thomasjm's full-sized avatar

Tom McLaughlin thomasjm

View GitHub Profile
tom@desktop2 development/ruby-modules (master) » ./runtests.sh
++ dirname ./runtests.sh
+ cd .
+ find . -name text.nix
++ find . -name test.nix
+ testfiles='./with-packages/test.nix
./bundler-env/test.nix
./bundled-common/test.nix'
+ nix-build -E 'with import <nixpkgs> {}; callPackage testing/driver.nix { testFiles = [ ./with-packages/test.nix
./bundler-env/test.nix
@nix { "action": "setPhase", "phase": "setupCompilerEnvironmentPhase" }
Running phase: setupCompilerEnvironmentPhase
Build with /nix/store/ki9kplpqm86wrw7f8gj0xfn26iwbkpa9-ghc-9.6.4.
@nix { "action": "setPhase", "phase": "unpackPhase" }
Running phase: unpackPhase
unpacking source archive /nix/store/iwhjcvs344p3vcpvfwjhf6w019xw3kvx-ghcide-2.5.0.0.tar.gz
source root is ghcide-2.5.0.0
setting SOURCE_DATE_EPOCH to timestamp 1000000000 of file ghcide-2.5.0.0/test/src/Development/IDE/Test.hs
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: patchPhase
@thomasjm
thomasjm / Main.hs
Last active October 30, 2023 05:34
Benchmarking Text to Vector conversion in Haskell
{-# LANGUAGE BangPatterns #-}
module Main (main) where
import Control.Monad
import Data.Maybe
import Data.String.Interpolate
import Data.Text as T
import qualified Data.Vector.Unboxed as VU
import Weigh
2023-04-26 01:31:20.5428 UTC [Debug] () --> {
"id": 1,
"jsonrpc": "2.0",
"method": "initialize",
"params": {
"capabilities": {
"general": {
"markdown": {
"parser": ""
},
@thomasjm
thomasjm / cling_logs_cmake_trace_expand
Created November 21, 2022 22:45
Trying to build Cling 0.9 on Nix with CMake --trace-expand
This file has been truncated, but you can view the full file.
warning: Git tree '/home/tom/tools/nixpkgs' is dirty
building '/nix/store/0wrxx60rz7jracyj9z5lv9ci8kwnwycb-cling-unwrapped-0.9.drv'...
cling-unwrapped> unpacking sources
cling-unwrapped> unpacking source archive /nix/store/79z3awvbfa17789j6mwhpnkcqv907cj4-clang
cling-unwrapped> source root is clang
cling-unwrapped> patching sources
cling-unwrapped> configuring
cling-unwrapped> fixing cmake files...
cling-unwrapped> cmake flags: -DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DCMAKE_INSTALL_LOCALEDIR=/nix/store/8fa0f0w5sz681cggid1jrzppsq54mgzz-cling-unwrapped-0.9/share/locale -DCMAKE_INSTALL_LIBEXECDIR=/nix/store/8fa0f0w5sz681cggid1jrzppsq54mgzz-cling-unwrapped-0.9/libexec -DCMAKE_INSTALL_LIBDIR=/nix/store/8fa0f0w5sz681cggid1jrzppsq54mgzz-cling-unwrapped-0.9/lib -DCMAKE_INSTALL_DOCDIR=/nix/store/8fa0f0w5sz681cggid1jrzppsq54mgzz-cling-unwrapped-0.9/share/doc/Clang -DCMAKE_INSTALL_INFODIR=/nix
FROM ubuntu:20.04
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y sudo curl emacs git
RUN mkdir /nix
RUN chmod a+rwx /nix
RUN adduser user --home /home/user --disabled-password --gecos "" --shell /bin/bash
USER user
# Copyright(c) Microsoft Corporation
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the License); you may not use
# this file except in compliance with the License. You may obtain a copy of the
# License at http://www.apache.org/licenses/LICENSE-2.0
#
# THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS
# OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY
# IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
@thomasjm
thomasjm / tex2svg.html
Created January 21, 2020 11:32
From running ./tex2svg "x^2 + y^2"
<html>
<head>
<style>
mjx-container[jax="SVG"] > svg {
overflow: visible;
}
mjx-container[jax="SVG"] > svg a {
fill: blue;
@thomasjm
thomasjm / default.nix
Created July 11, 2019 01:06
Attempted out-of-tree cling build
{ stdenv, fetchgit, fetchFromGitHub, cmake, glibc, libffi, makeWrapper, python }:
rec {
llvmClingPatched = stdenv.mkDerivation {
pname = "llvm-cling-patched";
version = "unstable-2018-11-20";
src = fetchgit {
url = "http://root.cern.ch/git/llvm.git";
rev = "e0b472e46eb5861570497c2b9efabf96f2d4a485"; # This is the head of the cling-patches branch
@thomasjm
thomasjm / manylinux1.nix
Last active February 15, 2019 00:40
Nix derivation for adding manylinux1 support to Python
{stdenv, pkgs}:
with stdenv.lib;
with pkgs;
rec {
# To be manylinux1 compatible, we have to be able to link against any of the libraries below (PEP 513)
# https://www.python.org/dev/peps/pep-0513
desiredLibraries = [
"libpanelw.so.5"