Skip to content

Instantly share code, notes, and snippets.

@Cortys
Cortys / toc.txt
Last active September 13, 2023 10:22
This script generates a sequence of Ghostscript commands for adding ToC metadata to a PDF.
Contents 8
Preface to the Second Edition 5
Preface to the First Edition 6
Introduction 1 [11]
I. Categories, Functors, and Natural Transformations 7 [10]
1. Axioms for Categories 7
2. Categories 10
3. Functors 13
@Cortys
Cortys / migrate_data.py
Last active March 11, 2022 00:23 — forked from weldpua2008/migrate_data.py
MLFlow migration script from filesystem to database tracking data. Adapted to support MLFlow 1.18+ and SQLite.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Migration From FileBased store of MLFlow 0.8 up to 1.8.0
Credits:
* Based on work of bnekolny https://gist.github.com/bnekolny/8ec96faa0d57913eea6bb7848c06b912
* Latest version https://gist.github.com/weldpua2008/7f0c4644d247bd0fc7ba9a83c2d337d5
requirements:
pyyaml version 5.1 was required
;; experimental versions of my init.coffee functions
(defn- wrap-in-tap [code]
(str "(let [value " code
" rr (try (resolve 'requiring-resolve) (catch Throwable _))]"
" (if-let [rs (try (rr 'cognitect.rebl/submit) (catch Throwable _))]"
" (rs '" code " value)"
" (tap> value))"
" value)"))
/**
* Modular.js 1.0
* 2013 - Clemens Damke
* License: WTFPL - Have fun! Credits only if you want to.
*/
var Modular=(function(){var h=window,f=function(i,k,l){var j=this;h[i]=this;j.init=l;f.loadModules(k,function(m){Object.getPrototypeOf(j).run.call(j,m)},i)};f.loaded={};f.modules={};f.path="";f.requiredBy={};f.isOk=function(i){return i%2==1};f.status=function(i){return this.status.codes[i]};f.status.codes={1:"Module already loaded",2:"Module could not be loaded",3:"Module loaded",4:"Module loaded but invalidly defined",5:"Circular requirement loop had to be interrupted at first link-back (may cause problems in one modules 'init()')"};f.setModulePath=function(i){if(i!==undefined){this.path=i}return this};f.setModules=function(i){if(i!==undefined){this.modules=i}return this};f.addModules=function(i){for(var j in i){this.modules[j]=i[j]}return this};var a=function(l,j){for(var k=0;k<l.length;k++){l[k].apply(f,j)}},e=function(i,j){if(!f.requiredBy[i]){f.requiredBy[i]={}}f.requiredBy[i][j]=true},d=function(