Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.
| "-- vim-go specific configuration | |
| " run :GoBuild or :GoTestCompile based on the go file | |
| function! s:build_go_files() | |
| let l:file = expand('%') | |
| if l:file =~# '^\f\+_test\.go$' | |
| call go#test#Test(0, 1) | |
| elseif l:file =~# '^\f\+\.go$' | |
| call go#cmd#Build(0) | |
| endif |
| package main | |
| type FuncIntInt func(int) int | |
| func memorized(fn FuncIntInt) FuncIntInt { | |
| cache := make(map[int]int) | |
| return func(input int) int { | |
| if val, found := cache[input]; found { | |
| println("Read from cache") |
| aa Afar | |
| ab Abkhazian | |
| af Afrikaans | |
| ak Akan | |
| sq Albanian | |
| am Amharic | |
| ar Arabic | |
| an Aragonese | |
| hy Armenian | |
| as Assamese |
I'm still very new to Kafka, eventsourcing, stream processing, etc. I'm in the middle of building my first production system with this stuff and am writing this at the request of a few folks on Twitter. So if you do have experience, please do me and anyone else reading this a favor by pointing out things I get wrong :)
| // Promise.all is good for executing many promises at once | |
| Promise.all([ | |
| promise1, | |
| promise2 | |
| ]); | |
| // Promise.resolve is good for wrapping synchronous code | |
| Promise.resolve().then(function () { | |
| if (somethingIsNotRight()) { | |
| throw new Error("I will be rejected asynchronously!"); |
| var db = mongoose.connect('mongodb://localhost:27017/DB'); | |
| // In middleware | |
| app.use(function (req, res, next) { | |
| // action after response | |
| var afterResponse = function() { | |
| logger.info({req: req}, "End request"); | |
| // any other clean ups |
| import org.eclipse.paho.client.mqttv3.MqttCallback; | |
| import org.eclipse.paho.client.mqttv3.MqttClient; | |
| import org.eclipse.paho.client.mqttv3.MqttConnectOptions; | |
| import org.eclipse.paho.client.mqttv3.MqttDeliveryToken; | |
| import org.eclipse.paho.client.mqttv3.MqttException; | |
| import org.eclipse.paho.client.mqttv3.MqttMessage; | |
| import org.eclipse.paho.client.mqttv3.MqttTopic; | |
| public class SimpleMqttClient implements MqttCallback { |