Script to install pantahub pvr from source using docker tag (default: latest), the script build the CLI from the source for the current platform and install it on ~/bin/pvr.
curl -o- -L https://git.io/fjEI1 | bash| // this file is not scope. You must use it inside a anonymus function and save in windows RandomList and RandomList2 or export those | |
| function createWeightedList (list, weight) { | |
| var weighed_list = []; | |
| for (var i = 0; i < weight.length; i++) { | |
| var multiples = weight[i] * 100; | |
| for (var j = 0; j < multiples; j++) { | |
| weighed_list.push(list[i]); | |
| } | |
| } |
| import _chain from 'pipeable' | |
| function WorkerWrapper () { | |
| var poster = function (data) { | |
| importScripts(data.funcFileUrl) | |
| data.params.length = Object.keys(data.params).length | |
| postMessage(workerCallBack.apply(null, Array.from(data.params))) | |
| } | |
| onmessage = function (e) { | |
| poster(e.data) |
| export default function useValidatedForm (fields = {}, descriptors = [], validators = ValidaJS.validators) { | |
| const initialErrorsObj = emptyErrorFactory(fields) | |
| const initialState = stateFactory(fields) | |
| const [state, setState] = useState(initialState) | |
| const [validation, setValidation] = useState({ valid: true, errors: initialErrorsObj }) | |
| const rulesBy = rulesByNameFactory(descriptors, validators) | |
| const form = formDataFactory(state, setState, setValidation, validation, rulesBy) | |
| const getData = () => getDataFromState(state) | |
| const setData = (data) => setState(stateFactory(data)) |
| import React from 'react' | |
| import useValidatedForm from 'react-valida-hook' | |
| const initialState = { | |
| firstName: '', | |
| lastName: '', | |
| email: '' | |
| } | |
| const validations = [ |
| import React from 'react' | |
| import useValidatedForm from 'react-valida-hook' | |
| const initialState = { | |
| firstName: '', | |
| lastName: '', | |
| email: '' | |
| } | |
| const validations = [ |
| import React, { useState } from 'react' | |
| import ReactDOM from 'react-dom' | |
| function UserForm () { | |
| const [errors, setErrors] = useState({}) | |
| const submit = (event) => { | |
| event.preventDefault() | |
| const form = event.target | |
| const isValid = form.checkValidity() // returns true or false |
| const compose = (fn, ...funcs) => { | |
| return (...args) => { | |
| return funcs.reduce((acc, func) => func(acc), fn(...args)) | |
| } | |
| } | |
| const generate = (fn, dependency = LazyIterable, descriptor) => { | |
| return Object.create( | |
| Object.assign({ [Symbol.iterator]: fn }, dependency), | |
| descriptor |
| { | |
| "name": "Sergio Marin", | |
| "nick_name": "highercomve", | |
| "tagline": "I'm a software engineer focused on web applications", | |
| "location": "Santiago, Chile", | |
| "networks": [ | |
| { | |
| "title": "Sergio Marin's Github page", | |
| "url": "https://github.com/highercomve", | |
| "icon": "github" |
| function filterIterable (filter, iterable) { | |
| const result = []; | |
| const entries = getEntries(iterable); | |
| for (const [key, value] of entries) { | |
| if (filter(value, key)) { | |
| result.push(value); | |
| } | |
| } | |
| return result; | |
| } |