(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
| #!/usr/bin/ruby | |
| # SIFTTTER 1.5: An IFTTT-to-Day One Logger by Craig Eley 2014 <http://craigeley.com> | |
| # Based on tp-dailylog.rb by Brett Terpstra 2012 <http://brettterpstra.com> | |
| # Multiple Date Function by Paul Hayes 2014 <http://paulrhayes.com> | |
| # | |
| # Notes: | |
| # * Uses `mdfind` to locate a specific folder of IFTTT-generated text files changed in the last day | |
| # * The location of your folder should be hardcoded in line 67, and the location of your Day One in line 66 | |
| # * Scans leading timestamps in each line matching the selected dates | |
| # * Does not alter text files in any way |
| (defun wc/narrow-window () | |
| (let (( new-right | |
| (max 0 (+ (or (cdr (window-margins)) 0) | |
| (- (window-body-width) fill-column))))) | |
| (set-window-margins nil (car (window-margins)) new-right) | |
| (set-window-fringes nil (car (window-fringes)) 2))) | |
| (define-minor-mode wrap-column-mode | |
| "Wrap the text at `fill-column'. | |
| Works by adjusting the right margin." |
| 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 |
| #!/usr/bin/python | |
| # All SSH libraries for Python are junk (2011-10-13). | |
| # Too low-level (libssh2), too buggy (paramiko), too complicated | |
| # (both), too poor in features (no use of the agent, for instance) | |
| # Here is the right solution today: | |
| import subprocess | |
| import sys |