This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"lastUpload":"2020-11-23T19:24:43.513Z","extensionVersion":"v3.4.3"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/id_rsa | |
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/github_rsa | |
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/mozilla_rsa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let regex; | |
/* matching a specific string */ | |
regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello" | |
regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO" | |
regex = /hello/g; // looks for multiple occurrences of string between the forward slashes... | |
/* wildcards */ | |
regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo" | |
regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/python3 | |
import random | |
def choose_name(names): | |
name = random.choice(names) | |
names.remove(name) | |
return name | |
names = input('Digite os nomes separados por vírgula. (Ex: Rodrigo, Raphael, Ralph...): \n') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from __future__ import print_function | |
import ldap | |
from apps.parametros.models import ModelParametros | |
class ActiveDirectoryUser: | |
"""Classe para um modelo de usuário com alguns atributos do AD.""" | |
def __init__(self, name='', username='', matricula='', is_rh=False, email=''): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup | |
from colorama import init,Fore,Back,Style | |
import sys | |
init() | |
class Chamado: | |
idGlobal = 1 | |
def __init__(self): | |
self.id = Chamado.idGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf.urls import url | |
from usuario import views | |
urlpatterns = [ | |
url(r'^cadastro/$',views.UsuarioCreateView.as_view(), name='cadastro' ), | |
url(r'^editar/(?P<slug>[-\w\W\d]+)/$',views.UsuarioUpdateView.as_view(), name='editar_cadastro'), | |
url(r'^senha/(?P<slug>[-\w\W\d]+)/$',views.PasswordChangeView.as_view(), name='senha'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def save(self, **kwargs): | |
''' | |
Sobrescreve o método save da classe alterando o slug da instância e atribuindo um UUID (Universal Unique Identifier). | |
''' | |
if not self.id: | |
self.slug = uuid.uuid4() | |
super().save(**kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Usuario(models.Model): | |
""" | |
Classe com campo slug. | |
""" | |
id = models.AutoField( | |
primary_key=True | |
) | |
slug = models.SlugField( | |
max_length=150, |