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 selenium.webdriver.common.keys import Keys | |
import time | |
from browsermobproxy import Server | |
import ast | |
import urllib2 as UR | |
import os | |
import eyed3 as ED3 | |
from django.utils.encoding import force_text | |
import re | |
from selenium import webdriver |
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 fuzzywuzzy import process | |
import keyboard | |
import speech_recognition as sr | |
r = sr.Recognizer() | |
m = sr.Microphone() | |
commands = { | |
"deploy landing gear": lambda: keyboard.write("l"), | |
"retract landing gear": lambda: keyboard.write("l"), |
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 __future__ import print_function | |
import boto3 | |
import json | |
print('Loading function') | |
def respond(err, res=None): | |
return { |
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
data = {'forecast': {'simpleforecast': {'forecastday': [{'avehumidity': 87, | |
'avewind': {'degrees': 161, | |
'dir': 'SSE', | |
'kph': 5, | |
'mph': 3}, | |
'conditions': 'Clear', | |
'date': {'ampm': 'PM', | |
'day': 28, | |
'epoch': '1488326400', | |
'hour': 19, |
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 itertools import cycle | |
class Player(object): | |
def __init__(self, token, name): | |
self.token = token | |
self.name = name | |
class ConnectFour(object): |
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/python | |
''' | |
Author: Igor Maculan - [email protected] | |
A Simple mjpg stream http server | |
''' | |
import cv2 | |
import Image | |
import threading | |
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer | |
from SocketServer import ThreadingMixIn |
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
"""Contains the User, Category, and Recipe classes""" | |
from types import SimpleNamespace | |
class DB(dict): | |
def query(self, **query_params): | |
results = [] | |
for key, obj in self.items(): | |
if all(getattr(obj, attr) == value for attr, value in query_params.items()): |
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 re | |
import json | |
import requests | |
from pprint import pprint | |
from bs4 import BeautifulSoup | |
def type_section(tag): | |
"""Find the tags that has the move type and pokemon name""" | |
pattern = r"[A-z]{3,} Type: [A-z]{3,}" | |
# if all these things are true, it should be the right tag |
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
""" | |
Decorator to convert string arguments into datetimes automatically. | |
The decorated function will also still accept datetime objects per normal. | |
Useful for commandline tools, for example. | |
import dateutil.parser | |
import datetime | |
@parse_dates('start', 'some_date') | |
def days_until(some_date, start=None): | |
if start_time is None: |
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 boto3 | |
client = boto3.client('codedeploy') | |
def lambda_handler(event, context): | |
s3_event = event['Records'][0].get('s3') | |
bucket_name = s3_event['bucket']['name'] | |
key = s3_event['object']['key'] | |
etag = s3_event['object']['eTag'] |
OlderNewer