Skip to content

Instantly share code, notes, and snippets.

iury IuryAlves

Block or report user

Report or block IuryAlves

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@IuryAlves
IuryAlves / ftpServer.py
Last active Jul 28, 2019
Uso básico de um servidor FTP implementado em python com a biblioteca pyftpdlib https://code.google.com/p/pyftpdlib/
View ftpServer.py
#encoding: utf-8
from pyftpdlib.authorizers import DummyAuthorizer
from pyftpdlib.handlers import FTPHandler
from pyftpdlib.servers import FTPServer
import sys
# importante: a biblioteca pyftpdlib não é padrão do python, precisa ser instalada
# link: https://code.google.com/p/pyftpdlib/downloads/list
@IuryAlves
IuryAlves / ftpClient.py
Last active Dec 11, 2018
Cliente FTP implementado em python
View ftpClient.py
# coding: utf-8
from ftplib import FTP
import log
import logging
#log.criarLog()
log.atualizarLog()
# A função abaixa um arquivo definido por 'filename' na pasta definida por local com o nome
# especificado por 'name'
def download(handler, name, filename="musica1.mp3"):
View cli.py
# CLI command line interface
# coding: utf-8
# using: python 2.7
import ftpClient as client
commands_list = ['Db', 'Q', 'L', 'Ub', 'H', 'Mv', 'Mk', 'Dl']
View log.py
# coding: utf-8
import time
tempo = time.localtime()
dia = tempo.tm_mday
mes = tempo.tm_mon
ano = tempo.tm_year
seg = tempo.tm_sec
arquivo = open('logs/log.txt','a')
def criarLog():
global arquivo,dia,mes,ano,seg
View escolha.py
import urllib.request
import random
palavras = urllib.request.urlopen(
'http://www.puzzlers.org/pub/wordlists/unixdict.txt'
).read().decode('iso8859').lower().split()
def escolha():
@IuryAlves
IuryAlves / Troca_cor_do_texto.html
Last active Dec 19, 2015
o script possui duas funções bem parecidas: body_nodes() , change_colors(new_color) A primeira lista as cores de todos os element nodes contidos no body do html. A segunda troca a cor de todos os element nodes para a cor espeficicada na função.
View Troca_cor_do_texto.html
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<title>Conteudo</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script type="text/javascript">
View corrigir_nomes.py
f = lambda lista: len(lista) == True
i = 0
def corrigirNome(nome):
nome=nome.strip()
prondliga=['dos','das']
prondliga2=['de','do','da']
if len(nome) > 3:
l = [i for i in range(len(nome)) if nome[i] in '0123456789']
if f(l) == True:
print('Não pode conter numeros')
View Teste.java
import java.util.List;
public class Teste {
public static void main(String[] args) {
Estoque e = new Estoque();
//cadastrando carros
View Jogo.java
import java.applet.Applet;
import java.awt.BorderLayout;
import java.awt.Button;
import java.awt.Event;
import java.awt.GridLayout;
import java.awt.Label;
import java.awt.Panel;
public class Jogo extends Applet{
View testesUnitarios.py
import unittest
def fat(n):
if n == 1 or n == 0:
return n
return fat(n - 1) * n;
class Test(unittest.TestCase):
You can’t perform that action at this time.