1 | 3 | 5 | 7 |
9 | 11 | 13 | 15 |
17 | 19 | 21 | 23 |
25 | 27 | 29 | 31 |
| | | | |
# https://community.spiceworks.com/t/powershell-convert-multi-line-string-variable-into-array/765578 | |
$pacotesTxt = "GitHub.GitHubDesktop | |
Git.Git | |
Microsoft.VisualStudioCode | |
Python.Python.3.12" | |
$pacotesVetor = $pacotesTxt -split "`r`n" | |
foreach ($pacote in $pacotesVetor) { |
#!/usr/bin/env python3 | |
import markdown | |
remetente = "estudante@jurandy.lab" | |
destinatario = "estudante@jurandy.lab" | |
mensagem = MIMEMultipart("Abracadabra") | |
mensagem["Subject"] = "Abracadabra" | |
mensagem["From"] = remetente |
''' | |
Code written for a Brazilian Portuguese audiance. | |
Please adjust the variables' names to your language. | |
''' | |
# I've written this Python code inspired by the following post: | |
# https://mathematica.stackexchange.com/questions/183624/how-to-construct-rectangular-figures-from-the-fibonacci-numbers | |
from collections import defaultdict | |
import turtle |
#!/usr/bin/env python3 | |
# String | |
nome = 'Fulano de Tal Pereira da Silva' | |
nome_min = nome.lower().replace(' ', '') | |
print(nome_min) | |
# List | |
lista_letras = list(nome_min) | |
print(lista_letras) |
import yaml | |
from pprint import pprint | |
dados = yaml.load(open('ex-redhat-01.yaml'), Loader=yaml.Loader) | |
pprint(dados, width=1) |
str=part1/part2/part3 | |
# part1 | |
echo ${str%%/*} | |
# part1/part2 | |
echo ${str%/*} | |
# part2 | |
echo ${${str%/*}#*/} | |
# part2/part3 | |
echo ${str#*/} | |
# part3 |
#!/usr/bin/env pwsh | |
$URL_CSV = 'https://raw.githubusercontent.com/jurandysoares/eleitores-ifrn-2019/master/csv/alunos.csv' | |
$ARQ_CSV = 'alunos.csv' | |
$info_texto = (Get-Culture).TextInfo | |
Invoke-WebRequest -Uri $URL_CSV -OutFile $ARQ_CSV | |
$nomes = (Import-Csv -Path $ARQ_CSV).Nome | |
$usuarios = @{} |
import shelve | |
def carregar_dados(): | |
# Dizer que é uma variável global | |
global dados | |
# Carregar objetos da estante | |
dados = shelve.open('base-dados-sistema') | |
global convidados | |
if 'convidados' in dados: |