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
`// function keepTry(fn, times = 3, acceptableExceptions = []) { | |
// let currentTime = 1; | |
// return function toExecute(...args) { | |
// try { | |
// const result = fn(...args); | |
// } catch (err) { | |
// if (acceptableExceptions.includes(err) && currentTime <= times) { | |
// currentTime++; | |
// return toExecute(...args); | |
// } |
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
function toPromise(fn, ...args) { | |
try { | |
return Promise.resolve(fn(...args)); | |
} catch (err) { | |
return Promise.reject(err); | |
} | |
} | |
function keepTry(times = 3, acceptableExceptions = [], fn) { | |
let currentTime = 1; |
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 os | |
import platform | |
def install_virtualenv(pip_version = ''): | |
try: | |
result = os.popen('pip{pip_version} install virtualenv'.format(pip_version=pip_version)).read() | |
return 'success'.upper() in result.upper() or 'requirement already satisfied'.upper() in result.upper() | |
except Exception as e: | |
print('Something happen wrong, ', e) | |
return False |
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
class Future { | |
slots = []; | |
completed = false; | |
value; | |
ready(slot) { | |
if (this.completed) { | |
slot(this.value); | |
} else { | |
this.slots.push(slot); |
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
// Exemplo "iscoolapp" não lembro qual ecmascript usa ai acho que es5. | |
function fetchUser(id) { | |
//busca o user pelo id, isso é um mock ok. | |
return Promise.resolve({ id: id, name: 'user', role: 'admin' }); | |
} | |
function fetchUserAddress(id) { | |
return Promise.resolve({ | |
userId: id, |
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
function processData(input) { | |
const splitedInput = input.split('\n'); | |
let currentIndex = -1; | |
const qtdOfBlackList = parseInt(head(splitedInput)); | |
currentIndex = 0; | |
const blackList = splitedInput.slice(currentIndex + 1, qtdOfBlackList + 1); | |
currentIndex += qtdOfBlackList + 1; | |
const restOfInput = splitedInput.slice(currentIndex); | |
currentIndex = 0; | |
const qtdOfGeneralList = parseInt(head(restOfInput)); |
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 webdriver = require('selenium-webdriver'); | |
const { By, until, keys } = webdriver; | |
let chrome = require('selenium-webdriver/chrome'); | |
let options = new chrome.Options(); | |
options.addArguments("user-data-dir=c:/Users/Derex/AppData/Local/Google/Chrome/User Data/DC/"); | |
let driver = new webdriver.Builder() | |
.forBrowser('chrome') |
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
<template is="dom-bind"> | |
<style> | |
vaadin-grid#material { | |
font-family: Roboto, sans-serif; | |
--divider-color: rgba(0, 0, 0, var(--dark-divider-opacity)); | |
--vaadin-grid-cell: { | |
padding: 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
var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; | |
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticP |
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
@extends('templates.template') | |
@section('conteudo') | |
@push('css') | |
<link href="{{asset('vendors/datatables.net-bs/css/dataTables.bootstrap.min.css')}}" rel="stylesheet"> | |
<link href="{{asset('vendors/datatables.net-responsive-bs/css/responsive.bootstrap.min.css')}}" rel="stylesheet"> | |
<link href="{{asset('vendors/datatables.net-scroller-bs/css/scroller.bootstrap.min.css')}}" rel="stylesheet"> | |
@endpush | |
<section class="col-md-12 col-sm-12 col-xs-12"> |