Skip to content

Instantly share code, notes, and snippets.

Morten Piibeleht mortenpi

  • Massey University
  • Auckland, New Zealand
Block or report user

Report or block mortenpi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View katex-bug.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>KaTeX rendering bug example</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.min.css" integrity="sha384-yFRtMMDnQtDRO8rLpMIKrtPCD5jdktao2TV19YiZYWMDkUR5GQZR/NOVTdquEx1j" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/katex.min.js" integrity="sha384-9Nhn55MVVN0/4OFx7EE5kpFBPsEMZxKTCnA+4fqDmg12eCTqGi6+BB2LjY8brQxJ" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.10.2/dist/contrib/auto-render.min.js" integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous" onload="renderMathInElement(document.body);"></script>
@mortenpi
mortenpi / partition.jl
Created Jun 4, 2019
Function to partition a set according to a predicate.
View partition.jl
"""
partition(f, xs)
Partitions a collection according to a predicate `f`. Similar to `filter`, but returns
the both the elements for which `f` is `true` and for which it is `false`, in two different
collections.
Returns a tuple of vectors, where the first vector contains the elements for which `f` is true
and the second the elements for which `f` is false.
"""
@mortenpi
mortenpi / sasscwatcher.jl
Last active May 30, 2019
A short program to watch changes in Sass files and recompile them automatically
View sasscwatcher.jl
# Copyright 2019 Morten Piibeleht
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this
# software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
# to whom the Software is furnished to do so, subject to the following conditions:
#
#The above copyright notice and this permission notice shall be included in all copies or
#substantial portions of the Software.
@mortenpi
mortenpi / documenter.js
Created Feb 18, 2019
Documenter.jl with Fortran highlighting
View documenter.js
/*
* Part of Documenter.jl
* https://github.com/JuliaDocs/Documenter.jl
*
* License: MIT
*
* Should be dropped into docs/src/assets/ and it will replace Documenter's own documenter.js.
*
* Assumes Documenter 0.21.4 -- make sure that Documenter is pinned to that version, just in case.
* Changes to Documenter in future versions may break this.
View Manifest.toml
[[Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
[[BinaryProvider]]
deps = ["Libdl", "Pkg", "SHA", "Test"]
git-tree-sha1 = "48c147e63431adbcee69bc40b04c3f0fec0a4982"
uuid = "b99e7846-7c00-51b0-8f62-c81ae34c0232"
version = "0.5.0"
[[CSV]]
@mortenpi
mortenpi / canonical-urls.diff
Last active Aug 22, 2018
gh-pages vs. gh-pages-update-to-v1
View canonical-urls.diff
diff -r -U1 v1.0.0-original/base/arrays/index.html v1.0.0/base/arrays/index.html
--- v1.0.0-original/base/arrays/index.html 2018-08-23 08:50:28.282999201 +1200
+++ v1.0.0/base/arrays/index.html 2018-08-23 08:50:27.483004523 +1200
@@ -20,3 +20,3 @@
<link rel="canonical" href=
-"https://docs.julialang.org/en/stable/base/arrays/index.html">
+"https://docs.julialang.org/en/v1/base/arrays/index.html">
<link href=
diff -r -U1 v1.0.0-original/base/base/index.html v1.0.0/base/base/index.html
--- v1.0.0-original/base/base/index.html 2018-08-23 08:50:28.378998563 +1200
View pycall-debug-build.log
julia> ENV["PYCALL_DEBUG_BUILD"]="yes"
"yes"
(pycall-523) pkg> build PyCall
Building Conda ─→ `~/.julia/packages/Conda/m7vem/deps/build.log`
Building PyCall → `dev/PyCall/deps/build.log`
Resolving package versions...
┌ Error: Error building `PyCall`:
│ ------------------------------------- exceptions -----------------------------------------
│ ---------------------------------- get_config_vars ---------------------------------------
View Manifest.toml
[[Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
[[ColorTypes]]
deps = ["FixedPointNumbers", "Random", "Test"]
git-tree-sha1 = "b45e62af8eabea138c381c04972c4b25d47e6c69"
uuid = "3da002f7-5984-5a60-b8a6-cbb66c0b333f"
version = "0.7.3"
[[Colors]]
@mortenpi
mortenpi / moduletestset.jl
Created Jul 31, 2018
at-testset for modules
View moduletestset.jl
using Test
macro moduletestset(ex)
@assert ex.head === :module
modulename = string("module ", ex.args[2])
modulecontents = ex.args[3]
# Add `using Test` as the first expression in the module so that the user could
# use @test etc. without having to have `using Test` all over the place.
pushfirst!(modulecontents.args, :(using Test))
# Just having `using Test` as the very first element in does not work for some
You can’t perform that action at this time.