Download the BCM20703A1-0a5c-6410.hcd
file as /lib/firmware/brcm/BCM-0a5c-6410.hcd
.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Gets the value at route of object. | |
* Look at: https://lodash.com/docs/4.17.4#get | |
* | |
* @param {Array|string} route The path of the property to get. | |
* @param {Object} obj The object to query. | |
* @return {*} Resolved value, or undefined. | |
*/ | |
function path (route, obj) { | |
if (!Array.isArray(route)) return path(route.split('.'), obj) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @file one-liner functional utilities in JavaScript | |
* @author Stefan Maric <[email protected]> | |
* @license | |
* Copyright © 2017 Stefan Maric <[email protected]> | |
* This work is free. You can redistribute it and/or modify it under the | |
* terms of the Do What The Fuck You Want To Public License, Version 2, | |
* as published by Sam Hocevar. See http://www.wtfpl.net/ for more details. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Create an new deferred promise that can be resolved/rejected from outside. | |
* @return {Promise} A new Promise with two extra methods: resolve and reject. | |
* | |
* @example | |
* const unknownResult = () => { | |
* const deferredPromise = defer() | |
* | |
* const errorTimeoutId = setTimeout( | |
* () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as _ from 'lodash' | |
const exclusion = (...arrays) => | |
_.flatMap(arrays, x => _.difference(x, ..._.without(arrays, x))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Wrapper around requestAnimationFrame for easier usage. | |
* @param {Function} callback Function to call on each tick, receives last value as only param. | |
* @param {*} [initValue] Optional initial value. | |
* @returns {Function} Clear interval function. | |
*/ | |
const tick = (callback, initValue) => { | |
let unsubscribed = false | |
let lastValue = initValue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Transform a number to any base based on a provided range. | |
* TODO: doesn't support floats. | |
* @param {number} baseTen A regular, primitive integer number | |
* @param {Array<string>} range And array of characters to represent the positional system. | |
* @returns {string} A representation of the provided number in the positional system provided. | |
*/ | |
const toBase = (baseTen, range = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('')) => { | |
if (baseTen % 1 > 0) throw new TypeError('Only integers are supported') | |
if (baseTen === 0) return range[0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const map = [0, 2, 4, 6, 8, 1, 3, 5, 7, 9] | |
const luhnCheck = (input) => { | |
const number = String(input).replace(/\D/g, '') | |
let sum = 0 | |
let digit = 0 | |
let i = number.length | |
let even = true | |
while (i) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const loadIframe = (url, attributes = {}, target = document.body) => | |
new Promise((resolve, reject) => { | |
const iframe = document.createElement('iframe') | |
const { | |
height = 0, | |
width = 0, | |
style = { | |
display: 'none', | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const defaultPredicate = (x) => x === null || x === undefined | |
const deepDefaults = (target, defaults, predicate = defaultPredicate) => { | |
if (Object(target) !== target) return Object.assign({}, defaults) | |
return Object.keys(defaults).reduce((acc, key) => { | |
if (Object(defaults[key]) === defaults[key]) { | |
acc[key] = deepDefaults(target[key] || {}, defaults[key], predicate) | |
} else { | |
acc[key] = predicate(target[key], key) ? defaults[key] : target[key] |