This pen is forked from: https://codepen.io/mikemang/pen/46b3f43f299a61e3584a7d1b77384b8c?editors=0110
A Pen by Samir ELSHARKAWY on CodePen.
| import { createStore, combineReducers, applyMiddleware } from 'redux' | |
| import { createLogger } from 'redux-logger' | |
| const mathReducer = (state = { | |
| result: 1, | |
| lastValues: [] | |
| }, action) => { | |
| switch (action.type) { | |
| case "ADD": | |
| state = { |
This pen is forked from: https://codepen.io/mikemang/pen/46b3f43f299a61e3584a7d1b77384b8c?editors=0110
A Pen by Samir ELSHARKAWY on CodePen.
| <div id="list"></div> |
brew install fish
curl -L https://get.oh-my.fish | fish| apiVersion: v1 | |
| kind: ServiceAccount | |
| metadata: | |
| name: admin-user | |
| namespace: kube-system | |
| --- | |
| apiVersion: rbac.authorization.k8s.io/v1beta1 | |
| kind: ClusterRoleBinding | |
| metadata: | |
| name: admin-user |
| const N_WORKERS = 5 | |
| class Content | |
| class Location | |
| class Reference { | |
| fun resolveLocation(): Location = TODO() | |
| } | |
| data class LocContent(val location: Location, val content: Content) |
| // from the talk https://www.youtube.com/watch?v=PTE4VJIdHPg | |
| // futures | |
| future := make(chan int, 1) | |
| go func() {future <- process() }() | |
| result := <-future | |
| // async await | |
| c := make(chan int, 1) | |
| go func() { c <- process() }() // async | |
| v := <-c // await |
| func MapVisitor(mapToVisit map[string]interface{}) { | |
| for k, v := range mapToVisit { | |
| switch val := v.(type) { | |
| case string: | |
| fmt.Println(k, "is string -> ", val) | |
| case float64: | |
| fmt.Println(k, "is float64 -> ", val) | |
| case map[string]interface{}: | |
| MapVisitor(v.(map[string]interface{})) | |
| case []interface{}: |
| package main | |
| import "fmt" | |
| // sem is a channel that will allow up to 10 concurrent operations. | |
| var sem = make(chan int, 10) | |
| func main() { | |
| for { | |
| sem <- 1 // will block if there is MAX ints in sem |