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
struct Alpha {} | |
trait Beta { | |
fn p(&self, z: &Beta) -> bool; | |
} | |
trait Gamma: Beta {} | |
impl Beta for Alpha { |
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 -L --fail "https://hub.docker.com/v2/repositories/${DOCKERHUB_REPO}/${DOCKERHUB_IMAGE}/tags/?page_size=1000" | \ | |
jq '.results | .[] | .name' -r | \ | |
sed 's/latest//' | \ | |
sort --version-sort | \ | |
tail -n 1 |
Using perf:
$ perf record -g binary
$ perf script | stackcollapse-perf.pl | rust-unmangle | flamegraph.pl > flame.svg
NOTE: See @GabrielMajeri's comments below about the
-g
option.
$ uname -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
docker run -v /Users/mbreese/tmp:/tmp1 -w /tmp1 -i centos:7 /bin/bash -s <<EOF | |
date > foo | |
echo 'foo' >> foo | |
cat /etc/redhat-release >> foo | |
whoami >> foo | |
EOF |
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 python2 | |
import SimpleHTTPServer | |
import SocketServer | |
import logging | |
PORT = 8000 | |
class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): |
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
#printf | |
RUN printf '#!/bin/bash\n\ | |
echo hello world from line 1\n\ | |
echo hello world from line 2'\ | |
>> /tmp/hello | |
#echo | |
RUN echo -e '#!/bin/bash\n\ | |
echo hello world from line 1\n\ | |
echo hello world from line 2'\ |
There is a danger with typeclasses only on functions because they permit a lack of coherence. This danger is particularly acute with collections, where the definition of a particular interface---such as hashable or ord---may be used in structuring the data structure. This renders the data structure corrupt when used with a different implementation.
To see the problem, consider a hashtable defined something like this:
NewerOlder