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 | |
import sys | |
start = 0 | |
left = 1 | |
right = 2 | |
up = 3 | |
down = 4 | |
def print_screen(matrix, time=0.3, last_frame=False): |
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
"""Música do elefante. | |
Digite a quantidade de vezes que vai contar, preferencialmente um número par. | |
""" | |
elefantes = int(input('Digite quantos elefantes quer contar: ')) | |
ini = "{numero} {plural} muita gente!\n{numero2} elefantes {incomodam} muito mais.\n" | |
for elefante in range(1, elefantes): | |
print(ini.format( | |
numero=elefante, |
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/env python3 | |
import subprocess | |
import getpass | |
import time | |
def get(command): | |
return subprocess.check_output(["/bin/bash", "-c", command]).decode("utf-8") | |
def execute(command): | |
subprocess.Popen(["/bin/bash", "-c", command]) |
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: utf-8 -*- | |
#!/usr/bin/python | |
import httplib, urllib, json, sys | |
from pprint import pprint | |
from datetime import datetime | |
import optparse | |
#URI = 'localhost:5008/static/feed.html' | |
URI = 'g1.globo.com/bemestar/no-ar/index.html' |
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 os | |
class Game(dict): | |
def __init__(self, number_of_piecies, frontend=lambda x:None, start_column=0b001, end_column=0b100): | |
super(Game, self).__init__() | |
for column in [0b001, 0b010, 0b100]: | |
self[column] = Column(self) | |
self.frontend = frontend(self) | |
for num in range(number_of_piecies,0,-1): | |
Piece(num,self,0b001) |
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
curl -XPOST "http://localhost:9200/example/" -d ' | |
{ | |
"settings":{ | |
"index":{ | |
"analysis":{ | |
"analyzer":{ | |
"my_analyzer":{ | |
"tokenizer" : "standard", | |
"filter" : ["standard", "lowercase", "my_metaphone"] |