Recommendations from others are noted in (parentheses). The rest are my personal recommendations.
- The Pragmatic Programmer - Hunt & Thomas
| # ================================================================================================== | |
| # | |
| # NOTICE | |
| # | |
| # This gist is no longer maintained. It was moved to repo: | |
| # | |
| # https://github.com/maratori/golangci-lint-config | |
| # | |
| # Full history and all v2 releases are preserved in the repo. | |
| # |
| // A Declarative Pipeline is defined within a 'pipeline' block. | |
| pipeline { | |
| // agent defines where the pipeline will run. | |
| agent { | |
| // This also could have been 'agent any' - that has the same meaning. | |
| label "" | |
| // Other possible built-in agent types are 'agent none', for not running the | |
| // top-level on any agent (which results in you needing to specify agents on | |
| // each stage and do explicit checkouts of scm in those stages), 'docker', |
| # Example makefile with some dummy rules | |
| .PHONY: all | |
| ## Make ALL the things; this includes: building the target, testing it, and | |
| ## deploying to server. | |
| all: test deploy | |
| .PHONY: build | |
| # No documentation; target will be omitted from help display | |
| build: |
| #!/usr/bin/osascript | |
| # usage: zoom <room-number> [room-password] [--name=NAME] | |
| on split(theString, theDelimiter) | |
| set oldDelimiters to AppleScript's text item delimiters | |
| set AppleScript's text item delimiters to theDelimiter | |
| set theArray to every text item of theString | |
| set AppleScript's text item delimiters to oldDelimiters | |
| return theArray |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <!-- Le styles --> | |
| <link href="../bootstrap/css/bootstrap.css" rel="stylesheet"> | |
| <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script> | |
| </head> | |
| <body> |
"For comprehension" is a another syntaxe to use map, flatMap and withFilter (or filter) methods.
yield keyword is used to aggregate values in the resulting structure.
This composition can be used on any type implementing this methods, like List, Option, Try, Future...
| 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 |
| (defn uuid [] (str (java.util.UUID/randomUUID))) |