Skip to content

Instantly share code, notes, and snippets.

View robsonsilv4's full-sized avatar
💭
💻 📝 👓

Robson Silva robsonsilv4

💭
💻 📝 👓
View GitHub Profile
@robsonsilv4
robsonsilv4 / views.py
Created August 23, 2018 00:39
Django override get_form on CreateView
class MyModelAdd(CreateView):
model = MyModel
def get_form(self):
type_form = self.request.GET.get('type')
if type_form == 'pf':
self.form_class = PFForm
else:
self.form_class = PJForm
return super(MyModelAdd, self).get_form()
#!/bin/bash
loadkeys br-abnt2
wifi-menu
pacman -Sy reflector
reflector --verbose --latest 200 --protocol http --protocol https --sort rate --save /etc/pacman.d/mirrorlist
mkfs.fat -F32 /dev/sda1
mkswap /dev/sda2
#!/bin/bash
# nano /etc/locale.gen
sed -i '/en_US.UTF-8 UTF-8/s/^#//g' /etc/locale.gen
locale-gen
echo 'LANG=en_US.UTF-8' >> /etc/locale.conf
echo 'KEYMAP=br-abnt2' /etc/vconsole.conf
echo 'archlinux' >> /etc/hostname
base-devel
pacman-contrib
bash-completion
linux-zen
linux-zen-headers
xorg-server
# xorg-xinit
ttf-dejavu
sudo woeusb --target-filesystem NTFS --device Win10_1809Oct_English_x64.iso /dev/sdb
@robsonsilv4
robsonsilv4 / README-Template.md
Created February 8, 2019 16:40 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@robsonsilv4
robsonsilv4 / rebase.sh
Created February 24, 2019 13:23
Modificar commit (rebase)
git log --oneline
git rebase --interactive commitasermodificado
git commit --all --amend --no-edit
git rebase --continue
@robsonsilv4
robsonsilv4 / CarrinhoController.java
Created June 22, 2019 23:44
Carrinho com Spring Boot e Thymeleaf
package com.ufc.br.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import com.ufc.br.exception.SemPratosSuficienteException;
@robsonsilv4
robsonsilv4 / ambiente-dev-python.md
Created July 7, 2019 01:49
💻 Ambiente de Desenvolvimento Python para Arch Linux e Ubuntu 18.04

Ambiente de Desenvolvimento Python para Arch Linux e Ubuntu

Passo a passo para te ajudar a montar o seu ambiente completo de desenvolvimento Python, utilizando como base o Arch Linux, Ubuntu 18.04.x e derivados.

Arch Linux

Primeiro, sincronize os repositórios e atualize o sistema utilizando o seguinte comando:

sudo pacman -Syyu
@robsonsilv4
robsonsilv4 / Dockerfile
Created September 17, 2019 19:04
Django Docker
FROM python:3.7-slim
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
WORKDIR /code
RUN pip install pipenv
COPY Pipfile Pipfile.lock /code/
RUN pipenv install --system