Skip to content

Instantly share code, notes, and snippets.

View NavarroMauro's full-sized avatar

Mauricio NavarroMauro

  • Private
  • Hamburg, Germany
View GitHub Profile
@NavarroMauro
NavarroMauro / comunas-regiones.json
Created February 11, 2024 22:43 — forked from juanbrujo/comunas-regiones.json
Comunas y regiones de chile JSON
{
"regiones": [
{
"region": "Arica y Parinacota",
"comunas": ["Arica", "Camarones", "Putre", "General Lagos"]
},
{
"region": "Tarapacá",
"comunas": ["Iquique", "Alto Hospicio", "Pozo Almonte", "Camiña", "Colchane", "Huara", "Pica"]
},
@NavarroMauro
NavarroMauro / basehandler.py
Created May 23, 2022 06:14 — forked from chenen3/basehandler.py
tornado helper
class BaseHandler(tornado.web.RequestHandler):
def __init__(self, application, request, **kwargs):
super(BaseHandler, self).__init__(application, request, **kwargs)
@property
def db(self):
return self.application.db
@staticmethod
def current_timestamp():
@NavarroMauro
NavarroMauro / auth.py
Created May 23, 2022 06:13 — forked from alejandrobernardis/auth.py
Tornado, Class Role, Permission, Identity (+mixin) and AuthContext
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2013 Asumi Kamikaze Inc.
# Copyright (c) 2013 The Octopus Apps Inc.
# Licensed under the Apache License, Version 2.0 (the "License")
# Author: Alejandro M. Bernardis
# Email: alejandro.bernardis at gmail.com
# Created: 04/Oct/2013 09:37
import urllib
@NavarroMauro
NavarroMauro / users.py
Created May 22, 2022 19:53 — forked from alejandrobernardis/users.py
Tornado Role
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012 The Octopus Apps Inc.
# Licensed under the Apache License, Version 2.0 (the "License")
#
# Author: Alejandro M. Bernardis
# Email: alejandro.m.bernardis at gmail.com
# Created: Feb 6, 2012, 2:44:12 PM
#
@NavarroMauro
NavarroMauro / GCI-Task-LoginPage.md
Created May 15, 2022 20:54 — forked from PolBaladas/GCI-Task-LoginPage.md
Creating a Login Page with Python Flask and SQLite 3 DB.

Login page using Python, Flask and sqlite3 DB

How-to guide

(Task for GCI 2015-16) Year: 2015-16 This guide will show how to create a simple login page with Flask (a python microframework) and a sqlite3 database.

1. Database Schema and Models

As we are creating a simple user login app we need to store 2 basic values in the database: the username and the password. In order to build the database we need to define a schema:

@NavarroMauro
NavarroMauro / logstash.conf
Last active April 29, 2022 10:25 — forked from markwalkom/logstash.conf
Reindexing Elasticsearch with Logstash 2.0
# Reindexing after chard and replicates changed
input {
elasticsearch {
hosts => [ "HOSTNAME_HERE" ]
port => "9200"
index => "INDEXNAME_HERE"
size => 1000
scroll => "5m"
docinfo => true
@NavarroMauro
NavarroMauro / conda cheat sheet
Created April 14, 2022 07:33 — forked from githubfoam/conda cheat sheet
conda anaconda cheat sheet
---------------------------------------------------------------------------------------------
#Installing in silent mode
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh
bash ~/miniconda.sh -b -p $HOME/miniconda
---------------------------------------------------------------------------------------------
#anaconda cloud
>anaconda login
git clone https://github.com/Anaconda-Platform/anaconda-client
cd anaconda-client/example-packages/conda/
@NavarroMauro
NavarroMauro / index.html
Last active September 19, 2018 07:45
Easy Mix Blend Modes font transparency using CSS
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>CutOut text effect using blending mode</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="screen" href="/css/style.css" />
</head>
@NavarroMauro
NavarroMauro / gist:4929f908746cbfdaeef08ab610235451
Created August 13, 2018 10:43 — forked from ivanoats/gist:1823034
Setting up GIT Bash autocompletion. Use this only if you are using Bash instead of ZSH.
@NavarroMauro
NavarroMauro / gist:7eb07254ff65021d6ff8c68ac7391a63
Created July 24, 2018 15:34 — forked from conormm/r-to-python-data-wrangling-basics.md
R to Python: Data wrangling with dplyr and pandas
R to python useful data wrangling snippets
The dplyr package in R makes data wrangling significantly easier.
The beauty of dplyr is that, by design, the options available are limited.
Specifically, a set of key verbs form the core of the package.
Using these verbs you can solve a wide range of data problems effectively in a shorter timeframe.
Whilse transitioning to Python I have greatly missed the ease with which I can think through and solve problems using dplyr in R.
The purpose of this document is to demonstrate how to execute the key dplyr verbs when manipulating data using Python (with the pandas package).
dplyr is organised around six key verbs