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
{ pkgs ? import <nixpkgs> { system = "x86_64-linux"; } }: | |
pkgs.dockerTools.buildImage { | |
name = "hello-docker"; | |
config = { | |
Cmd = [ "${pkgs.hello}/bin/hello" ]; | |
}; | |
} |
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
# -*- coding: utf-8 -*- | |
# Run this app with `DASH_URL_BASE_PATHNAME=/MY_PREFIX/ python app.py` and | |
# visit http://127.0.0.1:8050/MY_PREFIX/ in your web browser. | |
import dash | |
import dash_core_components as dcc | |
import dash_html_components as html | |
import plotly.express as px | |
import pandas as pd |
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
with import <nixpkgs> {}; | |
{ string ? "# hello"}: | |
let | |
input = writeTextFile { | |
name = "index.md"; | |
text = string; | |
}; | |
in | |
stdenv.mkDerivation { |
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
<head> | |
<!-- Plotly.js --> | |
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script> | |
</head> | |
<body> | |
<div id="myDiv"><!-- Plotly chart will be drawn inside this DIV --></div> | |
<script> | |
<!-- JAVASCRIPT CODE GOES HERE --> | |
</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
#!/bin/bash | |
N=20 | |
average_time () { | |
i=1 | |
while [ "$i" -le $N ]; | |
do eval $1 | |
i=$(($i+1)) | |
done 2>&1 | grep ^real | sed -e s/.*m// | awk '{sum +=$1} END {print sum / NR "s"}'; | |
} |
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
function xdoc = xmlread_xinclude(filename) | |
% Parse XML expanding XInclude tags | |
parserFactory = javaMethod('newInstance',... | |
'javax.xml.parsers.DocumentBuilderFactory'); | |
javaMethod('setXIncludeAware',parserFactory,true); | |
javaMethod('setNamespaceAware',parserFactory,true); | |
p = javaMethod('newDocumentBuilder',parserFactory); | |
xdoc=xmlread(filename,p); |