Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Lucas Pires flyingluscas

🏠
Working from home
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am flyingluscas on github.
  • I am flyingluscas (https://keybase.io/flyingluscas) on keybase.
  • I have a public key ASCr7huTEnQz6DhD9kN8HOC0PvwEkatu8GpA4XqxAJgxhAo

To claim this, I am signing this object:

View radix-sort.js
const unsortedArray = [123, 49, 7, 333]
const radix = (arr) => {
const max = Math.max(...arr).toString().length
const buckets = new Array(10)
let arrayWithLeftPaddedZeros = []
for (let i = 0; i < arr.length; i++) {
arrayWithLeftPaddedZeros[i] = arr[i].toString().padStart(max, '0')
}
@flyingluscas
flyingluscas / index.js
Created Aug 5, 2018
Uber Price Estimates
View index.js
const fetch = require('node-fetch')
const moment = require('moment')
const { delay } = require('bluebird')
const { find, pipe, prop, propEq } = require('ramda')
const estimateUberPrices = async () => {
const addresses = [
{
start_latitude: -23.631316,
start_longitude: -46.668384,
View goCircleCIGo.js
setInterval(() => {
if (document.querySelector('.css-1jwka9i').innerText === 'FAILED' || document.querySelector('.css-1jwka9i').innerText === 'CANCELED') {
document.querySelector('.css-1kqc31n').click()
document.querySelector('#menu-1 button:first-child').click()
console.log('Job reloaded!')
}
}, 60000)
View goTravisGo.js
setInterval(() => document.querySelectorAll('.jobs-list li.failed .action-button--restart').forEach(button => button.click()), 60000)
View spaceship.zsh-theme
#
# Spaceship ZSH Theme
#
# Author: Denys Dovhan, denysdovhan.com
# License: MIT
# https://github.com/denysdovhan/spaceship-zsh-theme
# ------------------------------------------------------------------------------
# CONFIGURATION
# The default configuration that can be overridden in .zshrc
View sweetalert.js
swal({
title: 'Bom trabalho!',
text: 'O seu pedido foi cadastrado com sucesso!',
icon: 'success',
button: 'Imprimir',
})
.then(function () {
window.location.href = '/cadastro/servico'
})
View laravel-assert-json-fragment.md
public function testPartialJsonResponse()
{
    $response = $this->json('GET', '/api/users/1');

    $response
        ->assertStatus(200)
        ->assertJsonFragment([
            'name' => 'Anakin Skywalker',
        ]);
View laravel-route-get-user-response.md
{
    "id": 1,
    "name": "Anakin Skywalker",
    "email": "anakin@death.star",
    "created_at": "2017-02-14 01:53:04",
    "updated_at": "2017-02-14 01:53:04"
}
View laravel-route-get-user.md
Route::get('/api/users/{id}', function ($id) {
    return App\User::find($id);
});
You can’t perform that action at this time.