Skip to content

Instantly share code, notes, and snippets.

View thomasjm's full-sized avatar

Tom McLaughlin thomasjm

View GitHub Profile
# 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"
...
installing /nix_frozen/store/rm886kfylvz4gz321scwq0i2kdbiy6s6-nodejs-10.12.0/lib/node_modules/npm/html/doc/cli/npm-shrinkwrap.html
installing /nix_frozen/store/rm886kfylvz4gz321scwq0i2kdbiy6s6-nodejs-10.12.0/lib/node_modules/npm/html/doc/cli/npm-cache.html
installing /nix_frozen/store/rm886kfylvz4gz321scwq0i2kdbiy6s6-nodejs-10.12.0/lib/node_modules/npm/html/doc/cli/npm-version.html
installing /nix_frozen/store/rm886kfylvz4gz321scwq0i2kdbiy6s6-nodejs-10.12.0/lib/node_modules/npm/html/doc/cli/npm-stars.html
installing /nix_frozen/store/rm886kfylvz4gz321scwq0i2kdbiy6s6-nodejs-10.12.0/lib/node_modules/n
builder for '/nix_frozen/store/7c31w5b5w4kxrkyqkln8dvhg3yp20y5l-nodejs-10.12.0.drv' failed with exit code 2
@thomasjm
thomasjm / lsp_repro.py
Created December 5, 2018 21:31
Repro for javascript-typescript-langserver issue 502
#!/usr/bin/python
import atexit
import os
import socket
import subprocess
from time import sleep
port = 5000
@thomasjm
thomasjm / gist:7a23341b56349c616e1534acc2280a3b
Created November 6, 2018 02:10
Output of `type nix-channel ; nix-channel -vvvvvvv --update`
nix-channel is /home/tom/tools/nix_build/bin/nix-channel
locking path '/home/tom/.cache/nix/tarballs/071qfgdy82dkn58wqsv1ri3zlch4amvvfgn5vmwh9fvb4spcv18y-file'
download thread waiting for 10000 ms
lock acquired on '/home/tom/.cache/nix/tarballs/071qfgdy82dkn58wqsv1ri3zlch4amvvfgn5vmwh9fvb4spcv18y-file.lock'
acquiring global GC lock '/nix_frozen/var/nix/gc.lock'
acquiring read lock on '/nix_frozen/var/nix/temproots/7044'
acquiring write lock on '/nix_frozen/var/nix/temproots/7044'
downgrading to read lock on '/nix_frozen/var/nix/temproots/7044'
lock released on '/home/tom/.cache/nix/tarballs/071qfgdy82dkn58wqsv1ri3zlch4amvvfgn5vmwh9fvb4spcv18y-file.lock'
error: path '/nix/store/p9bczv4dp4yk8qp9pq5sdvh56pl3hxyd-nixpkgs-unstable' is not in the Nix store