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
import org.bouncycastle.jce.ECNamedCurveTable; | |
import org.bouncycastle.jce.interfaces.ECPublicKey; | |
import org.bouncycastle.jce.provider.BouncyCastleProvider; | |
import org.bouncycastle.jce.spec.ECParameterSpec; | |
import org.bouncycastle.jce.spec.ECPublicKeySpec; | |
import org.bouncycastle.math.ec.ECPoint; | |
import java.security.*; | |
import java.util.Base64; |
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
<!doctype html> | |
<style>body { padding: 0; }</style> | |
<script src='https://cdn.jsdelivr.net/p5.js/0.3.2/p5.min.js'></script> | |
<script src='out/goog/base.js'></script> | |
<script src='myproject.js'></script> | |
<script>goog.require('myproject.core')</script> |
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
//! Unevaluated prototype of IETF RFC 8235 §3.3 with §4. | |
// [dependencies] | |
// elliptic-curve = "0.12.3" | |
// p256 = "0.11.1" | |
// sha2 = "0.10.6" | |
use std::cmp::min; | |
use std::ops::{Add, Mul}; |
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
///usr/bin/env jbang "$0" "$@" ; exit $? | |
//DEPS org.bouncycastle:bcprov-jdk18on:1.72 | |
import org.bouncycastle.crypto.digests.SHA256Digest; | |
import org.bouncycastle.jce.ECNamedCurveTable; | |
import org.bouncycastle.jce.spec.ECParameterSpec; | |
import org.bouncycastle.math.ec.ECPoint; | |
import java.math.BigInteger; |
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
package listhash | |
enum Expr: | |
case Atom(value: Array[Byte] | String | Symbol) extends Expr | |
case Comp(value: List[Expr]) extends Expr | |
opaque type ListHash = Array[Byte] | |
/** Inspired by https://github.com/benlaurie/objecthash */ | |
def listHash: Expr => ListHash = |
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
import scala.util.matching.Regex | |
val in = """# Systems | |
| | |
|## System 1 | |
| | |
|- Foo: bar | |
|- Baz: qux | |
|- Bla: | |
| 1. Bla |
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
(require '[figwheel-sidecar.repl-api :as repl]) | |
(def config | |
{:figwheel-options {} | |
:build-ids ["browser"] | |
:all-builds [{:id "browser" | |
:source-paths ["src/" "env/browser/"] | |
:figwheel {:on-jsload "id.client/main"} | |
:compiler {:output-to "public/js/app.js" | |
:output-dir "public/js" |
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
var bleancs = require('ble-ancs') | |
var t = require('transit-js') | |
var writer = t.writer('json') | |
var reader = t.reader('json') | |
function status(v) { | |
return t.map([t.keyword('type'), t.keyword('status'), | |
t.keyword('value'), t.keyword(v)])} | |
function notif(v) { | |
return t.map([t.keyword('type'), t.keyword('notification'), |
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
/** | |
* The following is a prototype to demonstrate how enterprise integration can be modelled using | |
* vanilla JavaScript. This could benefit service design: low-fidelity modelling of bounded contexts | |
* and messages makes ideas more tangible to explore and communicate. The model can be run inside | |
* an HTML page and tested using: | |
* | |
* dispatchEvent(new Event("test")); | |
* | |
* In this script I will refer to the following design domain concepts. | |
*/ |
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
<?php | |
// Plugin Name: Theme switcher | |
// Author: Sander Dijkhuis | |
require_once(ABSPATH . WPINC . '/pluggable.php'); | |
function theme_switcher_callback() { | |
return 'alternative-theme-name'; | |
} |
NewerOlder