Skip to content

Instantly share code, notes, and snippets.

View LuanComputacao's full-sized avatar
🏠
Working from home

LuanComputacao LuanComputacao

🏠
Working from home
View GitHub Profile
for PYFILE in $(find . -name '*.py'); do pep8 $PYFILE --count >> pep8.log; done
@LuanComputacao
LuanComputacao / Atom python
Last active March 7, 2017 14:05
Configurations to code in django framework
# To work with python
pip install --upgrade autopep8
pip install flake8
pip install flake8-docstrings
pip install iresolve
# To work with python and django
apm install python-tools
class DotExpandedDict(dict):
"""
- A special dictionary constructor that takes a dictionary in which the
- keys may contain dots to specify inner dictionaries. It's
- confusing, but this
- example should make sense.
-
- >>> d = DotExpandedDict({'person.1.firstname': ['Simon'], \
- 'person.1.lastname': ['Willison'], \
- 'person.2.firstname': ['Adrian'], \
@LuanComputacao
LuanComputacao / pegar_pontos_cartesianos.py
Created April 12, 2018 14:45
Captura uma string e retorna o dicionario de coordenadas
# coding=utf-8
def pegar_pontos_cartesianos(pontos_str):
"""Captura uma string e retorna o dicionario de coordenadas
Ex:
In :: pontos = pegar_pontos_cartesianos('P(0,2,3);Y(0.6,3.5,3.9);J(2,5,103)')
In :: print(pontos)
Out:: {'Y': [0.6, 3.5, 3.9], 'P': [0.0, 2.0, 3.0], 'J': [2.0, 5.0, 103.0]}
:param pontos_str: Representação de pontos cartesianos

Introduction

  • C-a == Ctrl-a
  • M-a == Alt-a

General

:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close
@LuanComputacao
LuanComputacao / fix_cedilla.sh
Created July 24, 2019 02:17
Fix the cedilla issue in Ubuntu
#Aplicações: QT (e KDE)
cd /usr/share/X11/locale/en_US.UTF-8
cp Compose Compose.original
cat Compose.original | sed -e 's/Ć/ć/' -e 's/Ç/ç/' > Compose
exit
#Aplicações: GTK (e Gnome)
cd /usr/lib/gtk-2.0/2.10.0/immodule-files.d/
cat libgtk2.0-0.immodules | sed -e 'az:ca:co:fr:gv:oc:pt:sq:tr:wa' -e 'en:az:ca:co:fr:gv:oc:pt:sq:tr:wa'
touch /etc/environment
@LuanComputacao
LuanComputacao / qualidade_de_codigo_usuarios_case.sh
Created February 13, 2020 15:38
Qualidade de Código: usuarios_case.sh
#!/bin/bash
#-------------------------------------------------------------------------------
# usuarios.sh
#-------------------------------------------------------------------------------
#
# Mostra os logins e nomes de usuários do sistema
# Obs: Lê dados do arquivo /etc/passwd
#
# Luan Roger, Março de 2016
// To execute
// gcc exemplo_de_troca_de_posicoes_em_c.c -o programinha && ./programinha
//
#include <stdio.h>
void trocaValor(int *vetorzinho, int primeiro, int segundo) // Definição da função "EsperaEnter"
{
int temporario = vetorzinho[primeiro];
vetorzinho[primeiro] = vetorzinho[segundo];
let times = 600000
let frase = "The quick red fox jumped over the lazy dog and ran away quickly";
function biggestWord(frase){
let biggest = '';
let words = frase.split(' ');
for(let i=0; i < words.length; i++){
if(words[i].length > biggest.length){
biggest = words[i];
}
@LuanComputacao
LuanComputacao / docker-compose.yml
Created August 8, 2020 01:05
Docker compose para MongoDB com armazenamento local
version: '3'
services:
databse:
image: 'mongo'
container_name: 'mongo-dota'
environment:
- MONGO_INITDB_DATABASE=dota
- MONGO_INITDB_ROOT_USERNAME=teomewhy
- MONGO_INITDB_ROOT_PASSWORD=123