- Either read the "File Contents" from a file or place the text into a multi-line block
- Parse the contents
- Aggregate the time (last field)
- Report of total calls
- Report any error cases (non-200)
- Bonus points: report what line number the error occured on
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 ~~Get gist raw url~~ > setup.sh | |
| # chmod +x ~/setup.sh | |
| # ~/setup.sh | |
| GIT_USERNAME=________ | |
| GIT_EMAIL=________ | |
| GITHUB_ACCOUNT_NAME=________ | |
| MAC_USERNAME=________ | |
| MAC_MACHINE_NAME=________ |
jq can filter keys with dashes (-), but that requires special syntax: [\"field-name\"]
Input:
echo '{"the-long-field-name":"true"}' | jq ". | select(.[\"the-long-field-name\"] != null)"
Output:
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
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
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
| Notes from 2019-04-24 PHX DevOps meetup | |
| Managing Secrets | |
| NoDramaDevOps.com Blog | |
| Platform Identity | |
| * Can give a VM a service account which has rights to access | |
| * Use short term credentials to talk between services. |
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 partition<A,B>(list: Vec<Result<A,B>>) -> (Vec<A>, Vec<B>) { | |
| let mut aa = vec!(); | |
| let mut bb = vec!(); | |
| for i in list { | |
| match i { | |
| Ok(a) => aa.push(a), | |
| Err(b) => bb.push(b), | |
| }; | |
| } | |
| (aa, bb) |
Below is a proposed data format to send UniVerse database changes via file. It uses standard UNIX delimiters for new lines, and standard UniVerse characters to deliniate fields (ASCII code 254 (þ)) and data (ASCII code 253 (ý)).
Example:
src=cssþns=CONTRACTSþts_ms=1550549470126þuid=12345678þop=uþdata=ý_id=1234ýname=Bobýþ
src=cssþns=CONTRACTSþts_ms=1550549470126þuid=12345678þop=uþdata=ý_id=1234ýname=Simonýþ
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
| module Lib | |
| ( someFunc | |
| ) where | |
| {-# LANGUAGE TemplateHaskell #-} | |
| {-# LANGUAGE OverloadedStrings #-} | |
| import Hedgehog | |
| import qualified Hedgehog.Gen as Gen | |
| import qualified Hedgehog.Range as Range |
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
| interface Integer2Integer { | |
| int apply(int n); | |
| } | |
| static int blah(Integer2Integer r) { return r.apply(99); } | |
| class Plus10 : Integer2Integer { Integer2Integer { int apply(int n) { return n + 10; } } | |
| Console.WriteLine(blah(new Plus())); // what does that print? | |
| maybe even a type alias | |
| type Integer2Integer = Int -> Int | |
| blah r = r 99 |
Thanks to @user#0540 and @Globi#0117 on the #beginners discord
Question:
Coming from JS/C#/Haskell and trying to understand the & and * a bit better. In this code snippet, the n in the lambda apparently can either be |&n| n%2==0 or |n| *n%2==0. Could some one explain this a bit better? I think its something to do with reference/defreferece, but still not comfortable with those ideas.
let arr: [u16; 5] = [1, 2, 3, 4, 5];
let mut iterator = arr.iter().filter(|&n| n%2==0);