Skip to content

Instantly share code, notes, and snippets.

@t0023656
t0023656 / simplePaint.py
Created July 16, 2023 15:24
100_Days_of_Code_100
import numpy as np
import pygame
from pygame.locals import *
from OpenGL.GL import *
from OpenGL.GLU import *
from Utils import *
def main_loop():
global end
@t0023656
t0023656 / line.py
Created July 12, 2023 08:27
100_Days_of_Code_099
import pygame
from pygame.locals import *
from OpenGL.GL import *
from OpenGL.GLU import *
from Utils import *
def main_loop():
global end
global can_draw
@t0023656
t0023656 / MousePlot.py
Created July 10, 2023 09:00
100_Days_of_Code_098
import pygame
from pygame.locals import *
from OpenGL.GL import *
from OpenGL.GLU import *
from Utils import *
def main_loop():
global end
while not end:
@t0023656
t0023656 / plot_points.py
Created July 5, 2023 14:37
100_Days_of_Code_097
import numpy as np
import pygame
from pygame.locals import *
from OpenGL.GL import *
from OpenGL.GLU import *
def main_loop():
global end
while not end:
@t0023656
t0023656 / asteroids.py
Created June 30, 2023 08:51
100_Days_of_Code_096
import random
import pygame
from pygame import Vector2
from pygame.transform import rotozoom
from pygame.mixer import Sound
def wrap_position(position, screen):
x, y = position
w, h = screen.get_size()
@t0023656
t0023656 / lord_of_the_rings_quote.py
Created June 25, 2023 16:46
100_Days_of_Code_095
import random
import requests
from flask import Flask, render_template
address = "https://the-one-api.dev/v2"
quote_endpoint = "/quote"
character_endpoint = "/character"
access_token = "11111111111111"
headers = {
"Authorization": f"Bearer {access_token}"
@t0023656
t0023656 / space_invaders.py
Created June 24, 2023 17:47
100_Days_of_Code_094
################## main.py ########################
import time
from turtle import Screen, Turtle
from player import Player
from enemy import Enemy
game_speed = 0.1
down_line = -200
up_line = 200
@t0023656
t0023656 / gameData.py
Created June 22, 2023 15:41
100_Days_of_Code_092
from bs4 import BeautifulSoup
import requests
import csv
headers = {
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36'}
response = requests.get("https://acg.gamer.com.tw/billboard.php?t=4&p=PC", headers=headers)
page = response.text
soup = BeautifulSoup(page, "html.parser")
game_boxes = soup.select('.ACG-mainbox1')
@t0023656
t0023656 / pdfToSpeech.py
Created June 20, 2023 15:06
100_Days_of_Code_090
"""Synthesizes speech from the input string of text or ssml.
Make sure to be working in a virtual environment.
Note: ssml must be well-formed according to:
https://www.w3.org/TR/speech-synthesis/
"""
from google.cloud import texttospeech
import PyPDF2
with open('test.pdf', 'rb') as pdfObj:
@t0023656
t0023656 / typing.py
Last active June 19, 2023 04:55
100_Days_of_Code_089
from tkinter import *
from tkinter.ttk import Progressbar
IS_COUNTING = False
COUNT_DOWN_SEC = 5
PROGRESS = 0
timer = None
update_progress_timer = None