Imagine we have a reducer to control a list of items:
function listOfItems(state: Array<Object> = [], action: Object = {}): Array<Object> {
switch(action.type) {
case 'SHOW_ALL_ITEMS':
return action.data.items
default:
# Export iOS code signing as p12 and mobileprovision file for usage in Appcenter | |
# Manual decryption as described on https://docs.fastlane.tools/actions/match/ | |
desc "Export fastlane match signing credentials for AppCenter" | |
lane :export_code_signing do | |
ensure_env_vars( | |
env_vars: [ | |
"MATCH_GIT_URL", | |
"MATCH_PASSWORD", | |
] |
<?php | |
# composer require web-token/jwt-framework | |
require_once 'vendor/autoload.php'; | |
use Jose\Component\Core\AlgorithmManager; | |
use Jose\Component\KeyManagement\JWKFactory; | |
use Jose\Component\Signature\Algorithm\ES256; | |
use Jose\Component\Signature\JWSBuilder; | |
use Jose\Component\Signature\Serializer\CompactSerializer; |
/* | |
* Copyright (C) 2016 Jeff Gilfelt. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
const axios = require('axios'); | |
const http = require('http'); | |
const https = require('https'); | |
module.exports = axios.create({ | |
//60 sec timeout | |
timeout: 60000, | |
//keepAlive pools and reuses TCP connections, so it's faster | |
httpAgent: new http.Agent({ keepAlive: true }), |
function mapValues(obj, fn) { | |
return Object.keys(obj).reduce((result, key) => { | |
result[key] = fn(obj[key], key); | |
return result; | |
}, {}); | |
} | |
function pick(obj, fn) { | |
return Object.keys(obj).reduce((result, key) => { | |
if (fn(obj[key])) { |
function eachKey(obj, f) { | |
for(var key in obj) { | |
if( obj.hasOwnProperty(key) ) | |
f(key, obj[key]); | |
} | |
} | |
function adtcase (base, proto, key) { | |
return (...args) => { | |
var inst = new base(); |
var sprintf = function (str) { | |
var args = Array.prototype.slice.call(arguments, 1), | |
hash = { | |
'%s': String, | |
'%d': parseInt, | |
'%f': parseFloat | |
}; | |
return str.replace(/%0(\d+)d/g, function (m, num) { | |
var r = String(args.shift()), | |
c = ''; |
var http = require('http'), | |
fileSystem = require('fs'), | |
path = require('path'), | |
util = require('util'); | |
http.createServer(function(request, response) { | |
var filePath = request.url.split('').slice(1).join(''); | |
var stat = fileSystem.statSync(filePath); | |
response.writeHead(200, { |