Skip to content

Instantly share code, notes, and snippets.

View MrValdez's full-sized avatar

MrValdez MrValdez

View GitHub Profile
@MrValdez
MrValdez / Six great things about Python 3.md
Last active May 8, 2020 11:05
I gave a talk at our @pythonph meetup. Here is a summary.

Six great things about Python 3

by github.com/MrValdez

  • What are f-strings? A Python 3.6 superpower
  • Python 3 installation that is helpful for complete beginners.
    • pip (3.4), virtualenv, and path installation
  • More helpful chained exceptions
  • The Windows py launcher
  • Ordered dictionary (3.6+)
@MrValdez
MrValdez / clipper.py
Created September 27, 2019 23:51
create clips from long videos
from moviepy.editor import *
output = "output.mp4"
# filename, start, end
files = [
(
"DRAGON BALL FighterZ 2019-09-22 22-25-58",
(3, 50),
None
import random
print(random.choice(["✌", "✊", "✋"]))
@MrValdez
MrValdez / main.py
Created March 16, 2018 13:24
2018 - Pizza, Beer and Code talks!
import pygame
import random
import math
pygame.init()
display = pygame.display.set_mode([1000, 800])
clock = pygame.time.Clock()
isRunning = True
#quiz6.py
# Make a program that stores a record of a person
# Ask the user if they want to print or change the record
# Use functions
# Name, Age, Gender
gender_choices = ["not given", "male", "female"]
record = {"Name": "Anonymous",
@MrValdez
MrValdez / natural_language_example.py
Created April 1, 2017 08:21
Basic example of natural language
# http://nltk.org/book
# https://spacy.io/docs/usage/showcase
import nltk
import random
def get_dataset():
boys = ["Ryan", "Azooz", "Jonard", "Chippo", "Pierre",
"John", "Michael", "Jordan", "Bobby", "Stephen"]
girls = ["Cypress", "Ammi", "Kathleen", "Ruby", "Jelly",
def recursion1(number):
evens = []
if number % 2 == 0:
evens += [number]
if number <= 0:
return evens
evens += recursion1(number - 1)
return evens
"""
So I was practicing my combo for xiaoyu when I came upon this video. (https://www.youtube.com/watch?v=cwwPr53mci4)
Problem is that the video creator didn't put in the proper notation so I had to eyeball how to do the combos.
Youtube is horrible for rewinding back to a specific time. I prefer using my video player. That's when I had the idea
to make this script to download and seperate the combos I'm interested in.
Note that there's a bug here where the filename saved is not xiaoyu.mp4. I had to comment out the download and re-run
the script with the filename renamed afterwards. ...but it works!
@MrValdez
MrValdez / bruteforce.py
Created March 6, 2016 02:13
Program demonstrating how a simple bruteforce works. Shown at Adamson University Python Workshop (Mar 2016)
# exercise7.py
import requests
import string
import random
url = "http://localhost:5000/auth"
data = {"username": "admin",
"password": ""}
#possible_inputs = string.ascii_letters + string.digits + ' '
import random
random.seed(0)
def MakeData():
Data = ["Spam"] * 5
Data.extend(["Eggs"] * 2)
Data.extend(["Ham"] * 2)
return Data