This file contains hidden or 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
window.onload = function () { | |
// Create the canvas | |
const canvas = document.createElement('canvas'); | |
canvas.width = canvas.height = 512; | |
document.body.appendChild(canvas) | |
const gl = canvas.getContext("webgl"); | |
// Set clear color to black, fully opaque | |
gl.clearColor(0.0, 0.0, 0.0, 1.0); | |
gl.clear(gl.COLOR_BUFFER_BIT); | |
// Create vertex shader |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
https://en.wikipedia.org/wiki/Box-drawing_character | |
┃┏┓┗┛━ | |
http://xahlee.info/comp/unicode_arrows.html | |
⯇ ⯈ ⯅ ⯆ | |
◀ ▶ ▲ ▼ | |
Dependency tree | |
└ ┌ ─ ├ |
This file contains hidden or 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
#/bin/sh | |
mkdir .env | |
mkdir .env/{upper,work,mount} | |
sudo mount -t overlay -o lowerdir=/,upperdir=.env/upper,workdir=.env/work overlayfs .env/mount | |
sudo mount -t proc proc .env/mount/proc | |
sudo mount -t sysfs sys .env/mount/sys | |
sudo mount -t devtmpfs dev .env/mount/dev | |
# Needed for tty | |
sudo mount --bind /dev/pts .env/mount/dev/pts |
This file contains hidden or 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
{ | |
"A": { | |
"0.1.2": { | |
"C": "~0.1.0", | |
"B": "~0.2.0" | |
}, | |
"0.1.0": { | |
"C": "~0.1.0", | |
"B": "~0.1.0" | |
}, |
This file contains hidden or 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
#!/bin/bash | |
# Usage: ./mirror-github-gitlab.sh | |
# The script will attempt to create all the projets. If some projects were already mirrored | |
# gitlab will return an error and the script will just ignore it. | |
GITHUB_URL=https://github.com | |
GITLAB_URL=https://gitlab.com | |
CURLCMD='curl --silent --show-error' |
This file contains hidden or 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
// Newton's method as explained here: https://youtu.be/U0xlKuFqCuI?t=290 | |
// To be used in the console of http://linalg.novidee.com or any environment with mathjs | |
function deriv(fcode, a, step = 0.01) { | |
return (fcode.eval({ x: a + step }) - fcode.eval({ x: a })) / step; | |
} | |
function newton(f, precision, seed = 0) { | |
const fcode = math.parse(f).compile(); |
This file contains hidden or 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
function modalityLutFunctor(s, i) { | |
return (x) => s * x + i; | |
} | |
function voiLutFunctor(wc, ww, maxOutput, minOutput) { | |
const left = wc - ww / 2; | |
const right = wc + ww / 2; | |
const a = (maxOutput - minOutput) / (right - left); | |
const b = -left * a; | |
return (x) => a * x + b; |
This file contains hidden or 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
fn main() { | |
let longest = vec![vec![1], vec![2, 3], vec![4]] | |
.into_iter() | |
.fold((vec![], 0), |acc, value| { | |
let length = value.len(); | |
if length > acc.1 { (value, length) } else { acc } | |
}); | |
println!("{:?}", longest); | |
} |
This file contains hidden or 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
curl -sOL https://www.x.org/releases/individual/lib/libXext-1.3.4.tar.gz | |
tar xf libXext-1.3.4.tar.gz | |
cd libXext-1.3.4 | |
./configure | |
make -j `nproc` | |
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:`pwd` | |
export CPPFLAGS="$CPPFLAGS -I`pwd`/include" | |
export LDFLAGS="$LDFLAGS -L`pwd`/src/.libs" | |
cd .. |