Skip to content

Instantly share code, notes, and snippets.

View sophiezhng's full-sized avatar
🌻
Learning new things!

Sophie Zhang sophiezhng

🌻
Learning new things!
View GitHub Profile
@sophiezhng
sophiezhng / fizzbuzz.py
Last active April 28, 2021 22:35
Fizz Buzz Python Solution
def main():
fizz_buzz(100)
return
def fizz_buzz(n):
for i in range(1,n+1):
output = ""
if i % 3 == 0:
output += "Fizz"
if i % 5 == 0:
@sophiezhng
sophiezhng / glow.css
Last active February 11, 2021 03:09
css glow animation! (from w3 schools)
/* code blocks */
code{
color: white;
-webkit-animation: glow 1s ease-in-out infinite alternate;
-moz-animation: glow 1s ease-in-out infinite alternate;
animation: glow 1s ease-in-out infinite alternate;
}
pre {
background-color: #222;
@sophiezhng
sophiezhng / colors_and_fonts.py
Created February 1, 2021 22:36
ANSI escape code with Python
class colors: # You may need to change color settings
BOLD = "\033[;1m"
UNDERLINE = "\033[;4m"
REVERSE = "\033[;7m"
RESET = "\033[0;0m"
BLACK = '\033[30m'
RED = '\033[31m'
GREEN = '\033[32m'
YELLOW = '\033[33m'
BLUE = '\033[34m'
@sophiezhng
sophiezhng / myspace_93_check_notifs.py
Last active June 6, 2021 09:35
Check MySpace Windows 93 notifications for a user
import json
import requests
user_id = "" #ENTER YOUR ID INSIDE THE QUOTES e.g., user_id = "31453"
def main():
r = requests.get('https://myspace.windows93.net/api.php?id='+user_id)
user = make_json_request(r)
notifs = user['notifications']
@sophiezhng
sophiezhng / export_leaderboard_file.py
Last active January 24, 2021 04:58
Check MySpace Windows 93's top 100 users with the most fwiends
import json
import requests
import time
limit = 100
# Write is formatted for .md files
path_to_file = "/Users/user/your/path/to/file"
def main():
sorted_users = get_users()
@sophiezhng
sophiezhng / edit_github_bio.py
Last active February 1, 2022 01:23
Edit your GitHub profile bio programmatically using Python and the GitHub API
import json
import requests
from getpass import getpass
# Login to GitHub and go to Settings > Developer settings > Personal access tokens and generate a new token.
# For scope click the user checkmark and generate token.
# Save it elsewhere as after you close the tab you will not be able to see it again on your profile.
api_token = getpass('API Token: ')
h = {'Accept': 'application/vnd.github.v3+json',