This file contains hidden or 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
| <?php | |
| function python($code) { | |
| return shell_exec("python -c '$code'"); | |
| } | |
| $python_code = " | |
| def fat(n): | |
| if n == 0: | |
| return 1 |
This file contains hidden or 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 wabot import WabotApp, reply | |
| app = WabotApp() | |
| @app.handler('group_message', command='!info') | |
| @app.handler('private_message', command='!info') | |
| def info(message, params): | |
| reply("I'm wabot. Your parameter is: %s" % str(params)) | |
| if __name__ == '__main__': |
This file contains hidden or 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/env python | |
| #-*- coding: utf-8 -*- | |
| import os | |
| import sys | |
| import fnmatch | |
| import argparse | |
| import re | |
| try: | |
| import i18n_conf | |
| except: |
This file contains hidden or 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/env python | |
| #-*- coding: utf-8 -*- | |
| from glob import iglob | |
| import re | |
| def get_locale(filename): | |
| locale_re = re.match(r'Resources_(?P<locale>[^\.]+).properties', filename) | |
| if locale_re: | |
| return locale_re.group('locale') |
This file contains hidden or 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
| # http://www.nike.com.br/Camisa-Masculina-CBF-I-Brasil-Jogador-252077.html | |
| # https://www.facebook.com/photo.php?v=683981728322039&fref=nf | |
| curl "http://www.nikedigitalsis.com.br/nikeid/_loja/admin/ws/blacklist.aspx?c=builder.callback_text&s=DILMA&sku=575276-703&id_sku=252079&_=1405046222159" |
This file contains hidden or 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
| #!/bin/bash | |
| play_file="play-2.2.3" | |
| playurl="http://downloads.typesafe.com/play/2.2.3/$play_file.zip" | |
| platform="`uname`" | |
| downloader="" | |
| if [[ $platform == 'Linux' ]]; then | |
| downloader='wget' | |
| elif [[ $platform == 'Darwin' ]]; then | |
| downloader='curl -O' | |
| fi |
This file contains hidden or 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/env python | |
| #-*- coding: utf-8 -*- | |
| class User(object): # Definição da classe User que herda de object(ler sobre new-stye class) | |
| # seq é um atributo da classe para contar quantas instâncias de User já foram salvas(chamaram o método save) | |
| seq = 0 | |
| # objects é a lista de instâncias de User que foram salvas(que chamaram o método save). | |
| # O atributo poderia ter qualquer nome. | |
| objects = [] |
This file contains hidden or 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 random | |
| class Character(object): | |
| NINJA_NAMES = ['Yumiko Reptile', 'Yori Ninja', 'Yuuko Zero'] | |
| def __init__(self, name, skills): | |
| self.name = name | |
| self.skills = skills |
This file contains hidden or 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: pt-br | |
| Funcionalidade: Log in no admin do django | |
| Cenário: Login no admin do django com usuário e senha corretos | |
| Dado o usuário "admin" e a senha "admin" | |
| Quando eu preencher o formulário de login e enviar os dados | |
| Então devo ver na tela a mensagem "Encerrar sessão" | |
| Cenário: Login no admin do django com usuário e senha incorretos | |
| Dado o usuário "usuario_invalido" e a senha "senha_invalida" |