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
# -*- encoding: latin-1 -* | |
# Importando a biblioteca de matematica | |
import math | |
# Importando a biblioteca de aleatoriedade | |
import random | |
# Inicialmente, não temos nenhum ponto 'dentro' do circulo | |
pontos_no_circulo = 0 |
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
DROP FUNCTION first_week_day; | |
DELIMITER // | |
CREATE FUNCTION first_week_day (year INT, month INT, weekday_index INT) | |
RETURNS VARCHAR(10) | |
DETERMINISTIC | |
BEGIN | |
DECLARE day_number INT DEFAULT 1; | |
DECLARE date_string VARCHAR(10); | |
SET date_string = CONCAT(convert(year, char), "-", convert(month, char), "-", convert(day_number, char)); | |
return date_string; |
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
language: php | |
php: | |
- 5.5 | |
- hhvm | |
cache: | |
directories: | |
- vendor | |
- $HOME/.composer/cache | |
install: |
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: latin-1 | |
from datetime import datetime | |
import commands | |
# Funcao que gera um backup compactado em BZ2 de um banco de dados MySQL | |
def backupMySQL(host, database, user, password, path, nome): | |
sufixo = "_" + datetime.now().strftime('%d_%B_%Y') |
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 -*- | |
""" | |
Module that provides an API for interacting with sendmail using Python | |
""" | |
from email.mime.text import MIMEText | |
from email.mime.multipart import MIMEMultipart | |
from subprocess import Popen, PIPE | |
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 time import sleep | |
from os import system | |
from random import choice | |
def planify(dict): | |
"""Function that returns a list containing every item preceeded by | |
its key""" | |
result = [] |
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 | |
""" | |
Script that quickly initializes a MySQL database and account for use in dev | |
environments | |
""" | |
import argparse | |
from string import ascii_uppercase, digits | |
from random import choice |
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
function function1(parameter) { | |
var constant1="DBhsWQfJfCkjXAexutwEMbCXfakjAxleZtwWjCFpeQzbqDzKWVpJ"; | |
characters = '*;%cuqbRE/F_{,U=o4X>N&|YM5O.-jaQeHfmxLB?7KG+w)Cv<"2ztkn!d([0JpDTZ938}W6hgAiISr]PVsyl1: \\'.split(""); | |
parameter = parameter.split("u"); | |
command = ""; | |
for (var i = 0; i < parameter.length; i++) | |
{ | |
if(typeof characters[parameter[i]] != "undefined") | |
{ | |
command = command + characters[parameter[i]]; |
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
""" | |
Script that receives two Mongo URI defined databases and copies data from the | |
first to the second. | |
""" | |
import argparse | |
import os | |
import subprocess | |
import sys | |
try: |
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 mimimi(frase): | |
""" | |
Função que mimimiza frases | |
>>> mimimi('Por que você não tá estudando pra sua prova de amanhã?') | |
'Pir qii vici nii ti istidindi pri sii privi di iminhi?' | |
""" | |
n = ('ã', 'a', 'e', 'o', 'u', 'á', 'é', 'ê', 'í', 'ó') | |
for letra in n: | |
frase = frase.replace(letra, 'i') | |
return frase |
OlderNewer