Skip to content

Instantly share code, notes, and snippets.

View maiquelleonel's full-sized avatar
🤓
This is happy to be useful.

Maiquel Leonel maiquelleonel

🤓
This is happy to be useful.
View GitHub Profile

Keybase proof

I hereby claim:

  • I am maiquelleonel on github.
  • I am maiquelleonel (https://keybase.io/maiquelleonel) on keybase.
  • I have a public key ASD1pSPYF_uXKKi-L_Nj4K69CGhkDaOYd-d7FONg2AvXTAo

To claim this, I am signing this object:

import subprocess
def tests():
subprocess.run(["python", "-u", "-m", "pytest"])
@maiquelleonel
maiquelleonel / geopoint.py
Last active October 26, 2020 15:47
calc if given geopoint (lat, lng) is inside a polygon
def inside_polygon(point, polygon):
lat, lng = point
inside = False
for index, geo_point in enumerate(polygon):
lat_i, lng_i = geo_point
lat_j, lng_j = polygon[index -1]
if (lat_i < lat and lat_j >= lat) or (lat_j < lat and lat_i >= lat):
if lng > lng_i + (lat * ((lng_j - lng_i)/(lat_j - lat_i))):
inside = not inside
@maiquelleonel
maiquelleonel / rpg.txt
Created April 26, 2020 22:41
RPG LIST
.
├── 0 - extras
│   ├── 2077.pdf
│   ├── 25 Arquétipos para personagens de RPG.pdf
│   ├── AFITA_-_RP000b_-_PLAYTESTE_v2.pdf
│   ├── AFITA_-_RP000c_-_NOITEFELIZ.pdf
│   ├── CS0001e_-_COSANOSTRAPLAYTESTE.pdf
│   ├── cthulhutech (quick start traduzido).pdf
│   ├── ghost_lines.pdf
│   ├── MB Demônios a Divina Comédia 3ª ed com extras da 1ª ed.pdf
"""
This exercise stub and the test suite contain several enumerated constants.
Since Python 2 does not have the enum module, the idiomatic way to write
enumerated constants has traditionally been a NAME assigned to an arbitrary,
but unique value. An integer is traditionally used because it’s memory
efficient.
It is a common practice to export both constants and functions that work with
those constants (ex. the constants in the os, subprocess and re modules).
[
{
"step":1,
"userId": "12324124124124123",
"locationUuid": "eb776924-deee-4561-8e22-c28c74ebbf83",
"activityId": "4e0425d2-403c-4f89-8108-e59db33ca63"
},
{
"step":2,
"optionId": 225,
@maiquelleonel
maiquelleonel / bodys_xaibot.txt
Created March 5, 2020 23:43
fluxo de bot para o consultor 1, erro de 0 resultados
{
"step":1,
"userId": "12324124124124123",
"locationUuid": "eb776924-deee-4561-8e22-c28c74ebbf83",
"activityId": "4e0425d2-403c-4f89-8108-e59db33ca63"
}
{
"step":2,
# -*- coding: utf-8 -*-
import scrapy
import sys
import re
reload(sys)
sys.setdefaultencoding('utf-8')
from w3lib.html import remove_tags
from isla.items import IslaItem
module.exports = function(agenda) {
agenda.define('my fantastic job', (job, done) => {
console.log(`My fantasitic job ${job.name} works properly!`)
done()
})
}
@maiquelleonel
maiquelleonel / get_period_price.php
Last active July 20, 2018 15:13
simple get period price
<?php
// migracão para a tabela
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePeriodPriceTable extends Migration
{
/**
* Run the migrations.