(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.
| You are Manus, an AI agent created by the Manus team. | |
| You excel at the following tasks: | |
| 1. Information gathering, fact-checking, and documentation | |
| 2. Data processing, analysis, and visualization | |
| 3. Writing multi-chapter articles and in-depth research reports | |
| 4. Creating websites, applications, and tools | |
| 5. Using programming to solve various problems beyond development | |
| 6. Various tasks that can be accomplished using computers and the internet |
| # https://github.com/messense/homebrew-macos-cross-toolchains | |
| brew tap messense/macos-cross-toolchains | |
| brew install x86_64-unknown-linux-gnu | |
| export CC_X86_64_UNKNOWN_LINUX_GNU=x86_64-unknown-linux-gnu-gcc | |
| export CXX_X86_64_UNKNOWN_LINUX_GNU=x86_64-unknown-linux-gnu-g++ | |
| export AR_X86_64_UNKNOWN_LINUX_GNU=x86_64-unknown-linux-gnu-ar | |
| export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-unknown-linux-gnu-gcc |
| package main | |
| import ( | |
| "crypto/rand" | |
| "flag" | |
| "log" | |
| mrand "math/rand" | |
| "net" | |
| "os" | |
| "os/signal" |
| var cheatCode = [38,38,40,40,37,39,37,39,66,65]; // Konami Cheat Code | |
| Rx.Observable | |
| .fromEvent(document, 'keydown') | |
| .map(function(x) { return x.keyCode; }) | |
| .windowWithCount(cheatCode.length, 1) | |
| .flatMap(function(xs) { return xs.toArray(); }) | |
| .do(function (x) { console.log(x); }) | |
| .filter(function(xs) { return _.isEqual(cheatCode, xs); }) | |
| .subscribe(function(x) { console.log('CHEATER!!11elf'); }); |
(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.
| convert source.png -resize 1920x1080 -background white -flatten TGA:- | cjpeg -quality 90 -targa -outfile compressed.jpg |
| var child_process = require('child_process'), | |
| assert = require('assert') | |
| var isChild = !!(process.send), | |
| isMaster = ((!isChild) && (process.argv.length > 2)), | |
| isTopLevel = (!isMaster && !isChild) | |
| if( isTopLevel ) { |
| /* | |
| A neuron is basically the sum of its synapses. | |
| Along with a trigger threshold, that's all we need to calculate | |
| whether or not it will trigger at any given moment: | |
| */ | |
| const neuron = ({ synapses = [], threshold = 1 } = {}) => ({ | |
| synapses, | |
| threshold | |
| }); |
| [ | |
| { | |
| "_id": "Gmail-Dashboard", | |
| "_type": "dashboard", | |
| "_source": { | |
| "title": "Gmail Dashboard", | |
| "hits": 0, | |
| "description": "", | |
| "panelsJSON": "[{\"col\":1,\"id\":\"Top-10-Worst-senders\",\"row\":4,\"size_x\":2,\"size_y\":5,\"type\":\"visualization\"},{\"col\":3,\"id\":\"Emails-Date-Histogram\",\"row\":1,\"size_x\":10,\"size_y\":3,\"type\":\"visualization\"},{\"col\":3,\"id\":\"Top-10-Senders\",\"row\":4,\"size_x\":2,\"size_y\":5,\"type\":\"visualization\"},{\"col\":1,\"id\":\"Total-Messages\",\"row\":1,\"size_x\":2,\"size_y\":3,\"type\":\"visualization\"},{\"col\":10,\"id\":\"Day-Of-Week\",\"row\":4,\"size_x\":3,\"size_y\":5,\"type\":\"visualization\"},{\"id\":\"Hour-Of-Day\",\"type\":\"visualization\",\"size_x\":5,\"size_y\":5,\"col\":5,\"row\":4}]", | |
| "version": 1, |
| var util = require('util'); | |
| var events = require('events'); | |
| var redis = require('redis'); | |
| var RedisQueueConsumer = function (port, host) { | |
| events.EventEmitter.call(this); | |
| this.port = port || 6379; | |
| this.host = host || '127.0.0.1'; | |
| }; |