Forces always come in pairs - known as "action-reaction force pairs."
It is basically the same concept as redux-modular-ducks but with a less loaded term in programming circles.
A force:
(function(exports){ | |
exports.valider = function valider(fnr) { | |
if (typeof fnr !== 'string') { | |
throw 'fødselsnummer er ikke en streng'; | |
} | |
if(fnr.split('').filter(function(d){ | |
return !isNaN(parseInt(d, 10)); | |
}).length !== 11){ |
from collections import defaultdict | |
liste = ["abc", "bca", "ab"] | |
grupper = defaultdict(list) | |
def hash(streng): | |
return ''.join(sorted(streng)) | |
for streng in liste: |
;; UTF-8 everything! | |
(set-terminal-coding-system 'utf-8) | |
(set-keyboard-coding-system 'utf-8) | |
(set-selection-coding-system 'utf-8) | |
(prefer-coding-system 'utf-8) |
#!/bin/bash | |
containers=$(docker ps -q -a) | |
volumes=$(docker inspect -f '{{ $n := .Name }}{{ range $k,$v := .Volumes}} {{ if eq $k "/var/log" }} -v {{ $v }}:/var/log{{$n}}{{end}}{{end}}' ${containers}) | |
exec docker run -d -v /etc/localtime:/etc/localtime:ro $volumes --name splunk -p 8000:8000 xeor/splunk |
export function mergeResults(...functions) { | |
return (...args) => functions.reduce((result, fn) => ({ ...result, ...fn(...args) }), {}); | |
} |
Forces always come in pairs - known as "action-reaction force pairs."
It is basically the same concept as redux-modular-ducks but with a less loaded term in programming circles.
A force:
const combineResults = async () => { | |
const [a, b, c] = await Promise.all([requestSlowly('a'), requestSlowly('b'), requestSlowly('c')]); | |
return a + b + c; | |
} |
function equals(a1, a2) { | |
return (a1.length == a2.length) && a1.every(function(element, index) { | |
return element === a2[index]; | |
}); |
import { Middleware, Action } from 'redux'; | |
// Grabbed from: | |
// https://github.com/reactjs/redux/blob/master/src/utils/isPlainObject.js | |
function isPlainObject(obj: any) { | |
if (typeof obj !== 'object' || obj === null) return false | |
let proto = obj | |
while (Object.getPrototypeOf(proto) !== null) { | |
proto = Object.getPrototypeOf(proto) |