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 bash | |
# traces a binary for 5s, writing out histograms of the latency of every `Futures::poll` fn | |
export BINARY_PATH="/home/ubuntu/projects/mini-redis/target/debug/mini-redis-server" | |
# generate `poll_latency.bpf` | |
echo "interval:s:5 { | |
print(@latency); |
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
:>database-raw.json | |
seq 0 57 \ | |
| xargs -I{} printf 'https://arts.st-andrews.ac.uk/monasticmatrix/monasticon/browse?page=%s\n' {} \ | |
| while read url ; do | |
xidel -se '//*[@class="view-content"]//a/@href' "$url" | |
done \ | |
| xargs -I{} printf 'https://arts.st-andrews.ac.uk%s\n' {} \ | |
| while read url ; do | |
xidel --ignore-namespaces --output-format json-wrapped -se ' |
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
curl -s 'https://api.github.com/repos/rust-itertools/itertools/pulls?state=open' \ | |
| jq -r '.[] | .number' \ | |
| pv -q -L4 \ | |
| xargs -I{} curl -s 'https://api.github.com/repos/rust-itertools/itertools/pulls/{}/files' \ | |
| jq -r '.[] | .filename' \ | |
| sort -u |
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 | |
. `which env_parallel.bash` | |
env_parallel --session | |
function enrolled_total() { | |
jq -rc '"<parent>" + .regdemog_html + "</parent>"' \ | |
| ( xidel - -s --xpath='one-or-more(//p[@class="enroll_demog"]/text())' 2>/dev/null \ | |
|| echo "null" ) \ | |
| cut -d' ' -f3 |
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
year | sats | |
---|---|---|
1960 | 42 | |
1961 | 58 | |
1962 | 98 | |
1963 | 95 | |
1964 | 124 | |
1965 | 175 | |
1966 | 170 | |
1967 | 173 | |
1968 | 161 |
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
macro_rules! pairs{ | |
() => {}; | |
($h : expr, $($t : expr,)*) => | |
{ | |
println!("({},{})", $h, $h); | |
$(println!("({},{})", $h, $t);)* | |
$(println!("({},{})", $t, $h);)* | |
pairs!{$($t,)*} | |
} | |
} |
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
/// Inspired by https://github.com/nastevens/predicates-rs/ | |
#![feature(conservative_impl_trait)] | |
use std::ops::*; | |
#[inline(always)] | |
fn partial<F, A, B, R>(f : F, b : B) | |
-> impl Fn(A) -> R | |
where F: Fn(&A, &B) -> R |
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] | |
name = "fireplace" | |
version = "0.0.1" | |
authors = ["John Wrenn <[email protected]>"] | |
[dependencies] | |
itertools = "0.5.4" | |
term_size = "0.2.1" |
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
git ls-files -z --others --exclude-standard \ | |
| xargs -0 -I{} stat -c "%Y %n" "{}" \ | |
| sort \ | |
| cut -d' ' -f 2- \ | |
| while read -r name; do | |
DATE=$(stat -c "%y" "$name") | |
git add "$name" | |
export GIT_AUTHOR_DATE="$DATE" | |
export GIT_COMMITTER_DATE="$DATE" | |
git commit -m "$name"; |
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
<?xml version="1.0"?> | |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:output method="text"/> | |
<xsl:template match="/other-reviews"> | |
<xsl:for-each select="review-header"> | |
<xsl:value-of select="@edition"/> | |
<xsl:text> </xsl:text> | |
<xsl:value-of select="enrollment"/> | |
<xsl:text>
</xsl:text> | |
</xsl:for-each> |
NewerOlder