docker ps --filter "status=exited" | grep 'months ago' | awk '{print $1}' \
| xargs --no-run-if-empty docker rm
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
def dump_speed_matrix(): | |
Fi = [ 372, 372, 558, 744, 1116, 1488, 1860, "RFU", "RFU", 512, 768, 1024, 1536, 2048, "RFU", "RFU"] | |
FMax = [ 4, 5, 6, 8, 12, 16, 20, "RFU", "RFU", 5, 7.5, 10, 15, 20, "RFU", "RFU"] | |
Di = ["RFU", 1, 2, 4, 8, 16, 32, 64, 12, 20, "RFU", "RFU", "RFU", "RFU", "RFU", "RFU"] | |
for fi in [0, 1, 2, 3, 4, 5, 6, 9, 10, 11, 12, 13]: | |
for di in [1, 2, 3, 4, 5, 6, 7, 8, 9]: | |
v = Fi[fi] / Di[di] | |
text = "Fi=%2s(%4d), Di=%2s(%2d), %4g cycles/ETU (%7d bits/s at 3.57 MHz, %7d bits/s for fMax=%4.1f MHz)" | |
args = (fi, Fi[fi], di, Di[di], v, 3570000 / v, FMax[fi] * 1000000 / v, FMax[fi]) |
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
# lambda recusion. | |
puts ->() { | |
error = ->(n) {throw "SHOULD NEVER BE CALLED"} | |
->(g) { | |
g.(g) | |
}.( | |
->(f) { | |
->(n) {n.zero? ? 1 : n * f.(f).(n-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
Optional = Struct.new(:value) do | |
def and_then(&block) | |
if value.nil? | |
Optional.new(nil) | |
else | |
block.call(value) | |
end | |
end | |
def method_missing(*args, &block) |
- List resources filter with specified pattern
gcloud alpha resources list --filter='utopian-theater-20112'
OlderNewer