Skip to content

Instantly share code, notes, and snippets.

View gustavo-sdo's full-sized avatar

Gustavo Santana gustavo-sdo

  • UNIPAR
  • Umuarama, PR, Brasil
View GitHub Profile
@gustavo-sdo
gustavo-sdo / disable-spinners.css
Created October 5, 2022 19:00 — forked from iame/disable-spinners.css
Disable input's spin buttons on firefox and chrome
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
input[type=number] {
-moz-appearance:textfield;
}
@gustavo-sdo
gustavo-sdo / admin.py
Created July 26, 2022 04:17 — forked from ninapavlich/admin.py
Custom configuration for django-autocomplete-light plugin
from django import forms
from django.contrib import admin
from dal import autocomplete, forward
class AdminAutocompleteFormMixin(forms.ModelForm):
class Media:
js = ('admin/autocomplete/forward.js',
'admin/autocomplete/select_admin_autocomplete.js')
@gustavo-sdo
gustavo-sdo / v1-ubuntu-docker-node-apt-get.sh
Created July 2, 2020 18:15 — forked from garystafford/v1-ubuntu-docker-node-apt-get.sh
Install the latest versions of Node.js and npm into a Docker Ubuntu container, with or without need for root access. Easily update both applications to the latest versions. Creates a new user account ('testuser') and installs common npm packages.
###############################################################################
# Version 1: using ‘apt-get install’
# Installs using apt-get
# Requires update to npm afterwards
# Harder to get latest copy of node
# Requires sudo to use npm
###############################################################################
# create new docker ubuntu container
sudo docker run -i -t ubuntu /bin/bash # drops you into container as root
#-------------------------------------------------------------------------------------------------------
# Código feito para consolidar as informações dos extratos
# mensais do CEI. Para rodar o script:
# 1) Baixe todos os extratos do ano e coloque na mesma pasta que estiver esse script.
# 2) Rode o script na pasta.
# 3) Verifique a saída no arquivo chamado "cei_consolidado.csv", que vai estar dentro da mesma pasta.
#
# Autor: Paulo Freire
# Data: 2020-03-05
#-------------------------------------------------------------------------------------------------------
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@gustavo-sdo
gustavo-sdo / Unicode table
Created March 30, 2017 04:05 — forked from ivandrofly/Unicode table
Unicode table - List of most common Unicode characters *
Unicode table - List of most common Unicode characters *
* This summary list contains about 2000 characters for most common ocidental/latin languages and most printable symbols but not chinese, japanese, arab, archaic and some unprintable.
Contains character codes in HEX (hexadecimal), decimal number, name/description and corresponding printable symbol.
What is Unicode?
Unicode is a standard created to define letters of all languages ​​and characters such as punctuation and technical symbols. Today, UNICODE (UTF-8) is the most used character set encoding (used by almost 70% of websites, in 2013). The second most used character set is ISO-8859-1 (about 20% of websites), but this old encoding format is being replaced by Unicode.
How to identify the Unicode number for a character?
Type or paste a character:
@gustavo-sdo
gustavo-sdo / gmail.py
Created March 8, 2017 00:23 — forked from jasonrdsouza/gmail.py
Python script to access a gmail account and download particular emails
import email, getpass, imaplib, os
detach_dir = '.' # directory where to save attachments (default: current)
user = raw_input("Enter your GMail username:")
pwd = getpass.getpass("Enter your password: ")
# connecting to the gmail imap server
m = imaplib.IMAP4_SSL("imap.gmail.com")
m.login(user,pwd)
m.select("cs2043") # here you a can choose a mail box like INBOX instead
@gustavo-sdo
gustavo-sdo / GitHub-Desktop-Bitbucket.md
Created March 2, 2017 01:59 — forked from glueckpress/GitHub-Desktop-Bitbucket.md
[How-to] Use GitHub Desktop to clone and commit to a Bitbucket repository just as you would with any GitHub repository. (Mac)

Clone Bitbucket Repository and Add it to GitHub Desktop App (Mac)

You can’t clone a Bitbucket repo using GithHub Desktop directly. Instead you would have to:

  1. Clone the Bitbucket repo locally via command line.
  2. Add the cloned repository to your GitHub Desktop app.

After completing these 2 steps, you’ll be able to execute sync, push, pull, commit, and other git commands available in GitHub Desktop for your Bitbucket repository just as you would for any GitHub repository.

You will need your Bitbucket repository’s git URL as available on the Overview page of your repository:

#List unique values in a DataFrame column
pd.unique(df.column_name.ravel())
#Convert Series datatype to numeric, getting rid of any non-numeric values
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True)
#Grab DataFrame rows where column has certain values
valuelist = ['value1', 'value2', 'value3']
df = df[df.column.isin(value_list)]
@gustavo-sdo
gustavo-sdo / customize-save-in-django-admin-inline-form.org
Created November 11, 2015 11:51 — forked from shymonk/customize-save-in-django-admin-inline-form.org
How to customize save in django admin inline form?

Customize Save In Django Admin Inline Form

Background

This is a common case in django ORM.

from django.db import models

class Author(models.Model):