This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const camelToKebab = camel => camel.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase(); | |
/* Inline all rules from all CSS stylesheets as attributes | |
on all matching elements and remove class attribute */ | |
const styles = Array.from(document.querySelectorAll("style")); | |
styles.forEach(styleSheet => { | |
Array.from(styleSheet.sheet.cssRules).forEach(rule => { | |
if (rule.style.display === "none") { | |
// Remove hidden elements | |
Array.from(document.querySelectorAll(rule.selectorText)).forEach(el => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: mit | |
height: 620 | |
border: no |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: mit | |
height: 620 | |
border: no |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.m | |
// TestSearch | |
// | |
// Created by Mikael Sand on 30/12/2017. | |
// Copyright © 2017 Mikael Sand. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
#include <mach/mach_time.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
const deg2rad = Math.PI / 180; | |
/* | |
a c e | |
( b d f ) | |
0 0 1 | |
*/ | |
function multiply_matrices(l, r) { | |
const [al, cl, el, bl, dl, fl] = l; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0x542753E9629cA5E2d260A9e67940812A2ddD0190 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Open console. | |
(Import https://raw.githubusercontent.com/MikeMcl/decimal.js/master/decimal.js first if you want/need number formatting) | |
Then copy & paste this + enter, to run this. | |
Copy console output to a NewFile.js or NewFile.jsx file. | |
prettier --write NewFile.js | |
*/ | |
/* eslint no-console: ["error", { allow: ["log"] }] */ | |
/* global document, Decimal*/ | |
(() => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module RBTree | |
(* Some fixes to make it work in the browser editor @ https://www.fstar-lang.org/tutorial/ | |
*) | |
(* | |
* Red black trees, and verification of Okasaki's insertion algorithm | |
* (https://wiki.rice.edu/confluence/download/attachments/2761212/Okasaki-Red-Black.pdf) | |
*) | |
(* CH: how does this compare to Andrew Appel's verified RB-trees | |
http://www.cs.princeton.edu/~appel/papers/redblack.pdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* Mikael Sand msand@abo.fi *) | |
theory AVLproject | |
imports Main Int | |
begin | |
datatype 'a tree = Tip | Node "'a tree" 'a "'a tree" | |
primrec height :: "'a tree \<Rightarrow> nat" where | |
"height Tip = 0" | | |
"height (Node l v r) = 1 + max (height l) (height r)" |